]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsx11.cpp
support for wxUSE_PALETTE = 0
[wxWidgets.git] / src / unix / utilsx11.cpp
index 7f46dcdbbf07328b56d271f5037f590d4e22f615..d4b4d521a30fee7ace59e1238595bf2077acfc06 100644 (file)
@@ -6,11 +6,14 @@
 // Created:     25.03.02
 // RCS-ID:      $Id$
 // Copyright:   (c) wxWindows team
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(__WXX11__) || defined(__WXGTK__) || defined(__WXMOTIF__)
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/unix/utilsx11.h"
 #include "wx/iconbndl.h"
 #include "wx/image.h"
@@ -74,6 +77,7 @@ public:
         XFlush(m_display);
         XSetErrorHandler(m_old);
     }
+
 private:
     Display *m_display;
     int (*m_old)(Display*, XErrorEvent *);
@@ -101,8 +105,11 @@ void wxSetIconsX11( WXDisplay* display, WXWindow window,
 
     if( size > 0 )
     {
-        wxUint32* data = new wxUint32[size];
-        wxUint32* ptr = data;
+//       The code below is correct for 64-bit machines also.
+//       wxUint32* data = new wxUint32[size];
+//       wxUint32* ptr = data;
+        unsigned long* data = new unsigned long[size];
+        unsigned long* ptr = data;
 
         for( i = 0; i < max; ++i )
         {
@@ -276,11 +283,7 @@ static bool wxQueryWMspecSupport(Display *display, Window rootWnd, Atom feature)
     
     // Is the WM ICCCM supporting?
     XGetWindowProperty(display, rootWnd,
-#ifdef __VMS
                        _NET_SUPPORTING_WM_CHECK, 0, LONG_MAX,
-#else
-                       _NET_SUPPORTING_WM_CHECK, 0, UINT_MAX,
-#endif
                        False, XA_WINDOW, &type, &format, &nwins,
                        &after, (unsigned char **)&wins);
     if ( type != XA_WINDOW || nwins <= 0 || wins[0] == None )
@@ -289,11 +292,7 @@ static bool wxQueryWMspecSupport(Display *display, Window rootWnd, Atom feature)
 
     // Query for supported features:
     XGetWindowProperty(display, rootWnd,
-#ifdef __VMS
-                      _NET_SUPPORTED, 0, LONG_MAX,
-#else
-                      _NET_SUPPORTED, 0, UINT_MAX,
-#endif
+                       _NET_SUPPORTED, 0, LONG_MAX,
                        False, XA_ATOM, &type, &format, &natoms,
                        &after, (unsigned char **)&atoms);
     if ( type != XA_ATOM || atoms == NULL )
@@ -408,17 +407,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)
     {
@@ -431,6 +442,7 @@ static void wxSetKDEFullscreen(Display *display, Window rootWnd,
         XMoveResizeWindow(display, w,
                           origRect->x, origRect->y,
                           origRect->width, origRect->height);
+        XSync(display, False);
     }
 }