xfreerdp: fix a possible re-size race condition
authorBernhard Miklautz <bernhard.miklautz@thincast.com>
Wed, 3 Dec 2014 17:08:01 +0000 (18:08 +0100)
committerBernhard Miklautz <bernhard.miklautz@thincast.com>
Wed, 3 Dec 2014 17:08:01 +0000 (18:08 +0100)
In case of server side initiated desktop resize it could happen that the
client was "scaling" even if smart-sizing was disabled. The reason for
this was that the "scaled" width and height was set when the X Configure
event arrived but not in xf_desktop_resize.

client/X11/xf_client.c

index d666d1f..f14f6fb 100644 (file)
@@ -231,13 +231,6 @@ static void xf_desktop_resize(rdpContext* context)
                                xfc->drawing = xfc->primary;
        }
 
-       if (!xfc->fullscreen)
-       {
-               if (xfc->window)
-                       xf_ResizeDesktopWindow(xfc, xfc->window, settings->DesktopWidth, settings->DesktopHeight);
-       }
-       else
-       {
 #ifdef WITH_XRENDER
                if (!xfc->settings->SmartSizing)
                {
@@ -245,6 +238,14 @@ static void xf_desktop_resize(rdpContext* context)
                        xfc->scaledHeight = xfc->height;
                }
 #endif
+
+       if (!xfc->fullscreen)
+       {
+               if (xfc->window)
+                       xf_ResizeDesktopWindow(xfc, xfc->window, settings->DesktopWidth, settings->DesktopHeight);
+       }
+       else
+       {
                XSetFunction(xfc->display, xfc->gc, GXcopy);
                XSetFillStyle(xfc->display, xfc->gc, FillSolid);
                XSetForeground(xfc->display, xfc->gc, 0);