diff --git a/src/server.c b/src/server.c index c97b5fd..a3d9939 100644 --- a/src/server.c +++ b/src/server.c @@ -509,6 +509,11 @@ static void process_fb_update_requests(struct nvnc_client* client) struct nvnc_fb* fb = client->server->display->buffer; assert(fb); + if (!client->has_pixfmt) { + rfb_pixfmt_from_fourcc(&client->pixfmt, fb->fourcc_format); + client->has_pixfmt = true; + } + if (fb->width != client->known_width || fb->height != client->known_height) send_desktop_resize(client, fb); @@ -1107,11 +1112,6 @@ static void do_client_update_fb(void* work) enum rfb_encodings encoding = choose_frame_encoding(client); - if (!client->has_pixfmt) { - rfb_pixfmt_from_fourcc(&client->pixfmt, fb->fourcc_format); - client->has_pixfmt = true; - } - switch (encoding) { case RFB_ENCODING_RAW: raw_encode_frame(&update->frame, &client->pixfmt, fb,