]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsx11.cpp
fixed memory leak (patch 685580)
[wxWidgets.git] / src / unix / utilsx11.cpp
index 465f7bec901e776f8b7b30cf48f0194fe4c92e59..d2145aaa37bd6d3a6da7c0ef875e8c5ecdbadfb2 100644 (file)
@@ -276,7 +276,7 @@ static bool wxQueryWMspecSupport(Display *display, Window rootWnd, Atom feature)
     
     // Is the WM ICCCM supporting?
     XGetWindowProperty(display, rootWnd,
-                       _NET_SUPPORTING_WM_CHECK, 0, UINT_MAX,
+                       _NET_SUPPORTING_WM_CHECK, 0, LONG_MAX,
                        False, XA_WINDOW, &type, &format, &nwins,
                        &after, (unsigned char **)&wins);
     if ( type != XA_WINDOW || nwins <= 0 || wins[0] == None )
@@ -285,7 +285,7 @@ static bool wxQueryWMspecSupport(Display *display, Window rootWnd, Atom feature)
 
     // Query for supported features:
     XGetWindowProperty(display, rootWnd,
-                       _NET_SUPPORTED, 0, UINT_MAX,
+                       _NET_SUPPORTED, 0, LONG_MAX,
                        False, XA_ATOM, &type, &format, &natoms,
                        &after, (unsigned char **)&atoms);
     if ( type != XA_ATOM || atoms == NULL )
@@ -400,17 +400,29 @@ static void wxSetKDEFullscreen(Display *display, Window rootWnd,
     }
 
     // it is neccessary to unmap the window, otherwise kwin will ignore us:
+    XSync(display, False);
+    
     bool wasMapped = IsMapped(display, w);
     if (wasMapped)
+    {
         XUnmapWindow(display, w);
+        XSync(display, False);
+    }
+
     XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
                        PropModeReplace, (unsigned char *) &data, lng);
+    XSync(display, False);
+
     if (wasMapped)
+    {
         XMapRaised(display, w);
+        XSync(display, False);
+    }
     
     wxWMspecSetState(display, rootWnd, w, 
                      fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE,
                      _NET_WM_STATE_STAYS_ON_TOP);
+    XSync(display, False);
 
     if (!fullscreen)
     {
@@ -423,6 +435,7 @@ static void wxSetKDEFullscreen(Display *display, Window rootWnd,
         XMoveResizeWindow(display, w,
                           origRect->x, origRect->y,
                           origRect->width, origRect->height);
+        XSync(display, False);
     }
 }