xfreerdp: fix fullscreen window toggle
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Wed, 14 Sep 2011 02:20:04 +0000 (22:20 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Wed, 14 Sep 2011 02:20:04 +0000 (22:20 -0400)
client/X11/xf_gdi.c
client/X11/xf_window.c
client/X11/xfreerdp.c
client/X11/xfreerdp.h

index cb40a74..e40ea73 100644 (file)
@@ -334,8 +334,6 @@ void xf_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
        }
        else if (brush->style == GDI_BS_PATTERN)
        {
-               printf("pattern bpp:%d\n", brush->bpp);
-
                if (brush->bpp > 1)
                {
                        pattern = xf_bitmap_new(xfi, 8, 8, brush->bpp, brush->data);
index e5d45f9..634b93c 100644 (file)
@@ -72,10 +72,7 @@ void xf_SetWindowFullscreen(xfInfo* xfi, xfWindow* window, boolean fullscreen)
 
                 XMoveResizeWindow(xfi->display, window->handle, 0, 0, window->width, window->height);
                 XMapRaised(xfi->display, window->handle);
-                //XGrabPointer(xfi->display, window->handle, True, 0, GrabModeAsync, GrabModeAsync, window->handle, 0L, CurrentTime);
-                //XGrabKeyboard(xfi->display, window->handle, False, GrabModeAsync, GrabModeAsync, CurrentTime);
 
-               //XSetInputFocus(xfi->display, window->handle, RevertToParent, CurrentTime);
                window->fullscreen = True;
        }
 }
@@ -218,10 +215,8 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height)
 
                if (class_hints != NULL)
                {
-                       if (name != NULL)
-                               class_hints->res_name = name;
-
-                       class_hints->res_class = "freerdp";
+                       class_hints->res_name = "xfreerdp";
+                       class_hints->res_class = "xfreerdp";
                        XSetClassHint(xfi->display, window->handle, class_hints);
                        XFree(class_hints);
                }
@@ -237,6 +232,8 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height)
                XMapWindow(xfi->display, window->handle);
        }
 
+       XStoreName(xfi->display, window->handle, name);
+
        return window;
 }
 
index 7c2879a..bb2c7ea 100644 (file)
@@ -204,7 +204,9 @@ void xf_toggle_fullscreen(xfInfo* xfi)
        contents = XCreatePixmap(xfi->display, xfi->window->handle, xfi->width, xfi->height, xfi->depth);
        XCopyArea(xfi->display, xfi->primary, contents, xfi->gc, 0, 0, xfi->width, xfi->height, 0, 0);
 
+       XDestroyWindow(xfi->display, xfi->window->handle);
        xfi->fullscreen = (xfi->fullscreen) ? False : True;
+       xf_post_connect(xfi->instance);
 
        XCopyArea(xfi->display, contents, xfi->primary, xfi->gc, 0, 0, xfi->width, xfi->height, 0, 0);
        XFreePixmap(xfi->display, contents);
@@ -358,6 +360,7 @@ boolean xf_pre_connect(freerdp* instance)
        xfi->decoration = settings->decorations;
        xfi->remote_app = settings->remote_app;
        xfi->fullscreen = settings->fullscreen;
+       xfi->fullscreen_toggle = xfi->fullscreen;
 
        xf_detect_monitors(xfi, settings);
 
@@ -405,7 +408,7 @@ boolean xf_post_connect(freerdp* instance)
 
        if (xfi->remote_app != True)
        {
-               xfi->window = xf_CreateDesktopWindow(xfi, "xfreerdp", xfi->width, xfi->height);
+               xfi->window = xf_CreateDesktopWindow(xfi, "FreeRDP", xfi->width, xfi->height);
 
                xf_SetWindowDecorations(xfi, xfi->window, xfi->decoration);
 
index c4e12de..4510e0c 100644 (file)
@@ -112,6 +112,7 @@ struct xf_info
 };
 
 void xf_toggle_fullscreen(xfInfo* xfi);
+boolean xf_post_connect(freerdp* instance);
 
 #ifdef WITH_DEBUG_X11
 #define DEBUG_X11(fmt, ...) DEBUG_CLASS(X11, fmt, ## __VA_ARGS__)