hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr
authorJon TURNEY <jon.turney@dronecode.org.uk>
Sun, 31 Mar 2013 17:35:35 +0000 (18:35 +0100)
committerJon TURNEY <jon.turney@dronecode.org.uk>
Mon, 10 Jun 2013 14:48:08 +0000 (15:48 +0100)
winMultiWindowGetTransientFor() accesses the WM_TRANSIENT_FOR property, which is
an X window XID (which we compare with WINDOW_WID_PROP) and not a WindowPtr.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin/winmultiwindowclass.c
hw/xwin/winmultiwindowclass.h
hw/xwin/winmultiwindowwindow.c

index 1af104d..ced8f45 100644 (file)
@@ -213,7 +213,7 @@ winMultiWindowGetWMNormalHints(WindowPtr pWin, WinXSizeHints * hints)
 }
 
 int
-winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
+winMultiWindowGetTransientFor(WindowPtr pWin, Window *pDaddyId)
 {
     struct _Window *pwin;
     struct _Property *prop;
@@ -230,13 +230,13 @@ winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
     else
         prop = NULL;
 
-    if (ppDaddy)
-        *ppDaddy = NULL;
+    if (pDaddyId)
+        *pDaddyId = 0;
 
     while (prop) {
         if (prop->propertyName == XA_WM_TRANSIENT_FOR) {
-            if (ppDaddy)
-                memcpy(ppDaddy, prop->data, sizeof(WindowPtr));
+            if (pDaddyId)
+                memcpy(pDaddyId, prop->data, sizeof(Window));
             return 1;
         }
         else
index 0e3465c..3244f78 100644 (file)
@@ -118,6 +118,6 @@ int
  winMultiWindowGetWMName(WindowPtr pWin, char **wmName);
 
 int
- winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy);
+ winMultiWindowGetTransientFor(WindowPtr pWin, Window *ppDaddy);
 
 #endif
index 0948156..dcbfaff 100644 (file)
@@ -486,7 +486,7 @@ winCreateWindowsWindow(WindowPtr pWin)
     winWindowPriv(pWin);
     winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
     WinXSizeHints hints;
-    WindowPtr pDaddy;
+    Window daddyId;
     DWORD dwStyle, dwExStyle;
     RECT rc;
 
@@ -516,10 +516,10 @@ winCreateWindowsWindow(WindowPtr pWin)
     winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
              iY);
 
-    if (winMultiWindowGetTransientFor(pWin, &pDaddy)) {
-        if (pDaddy) {
+    if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
+        if (daddyId) {
             hFore = GetForegroundWindow();
-            if (hFore && (pDaddy != (WindowPtr) GetProp(hFore, WIN_WID_PROP)))
+            if (hFore && (daddyId != (Window) GetProp(hFore, WIN_WID_PROP)))
                 hFore = NULL;
         }
     }