hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr

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>
This commit is contained in:
Jon TURNEY 2013-03-31 18:35:35 +01:00
parent be201ac257
commit e1a0945e8d
3 changed files with 10 additions and 10 deletions

View File

@ -213,7 +213,7 @@ winMultiWindowGetWMNormalHints(WindowPtr pWin, WinXSizeHints * hints)
} }
int int
winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy) winMultiWindowGetTransientFor(WindowPtr pWin, Window *pDaddyId)
{ {
struct _Window *pwin; struct _Window *pwin;
struct _Property *prop; struct _Property *prop;
@ -230,13 +230,13 @@ winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
else else
prop = NULL; prop = NULL;
if (ppDaddy) if (pDaddyId)
*ppDaddy = NULL; *pDaddyId = 0;
while (prop) { while (prop) {
if (prop->propertyName == XA_WM_TRANSIENT_FOR) { if (prop->propertyName == XA_WM_TRANSIENT_FOR) {
if (ppDaddy) if (pDaddyId)
memcpy(ppDaddy, prop->data, sizeof(WindowPtr)); memcpy(pDaddyId, prop->data, sizeof(Window));
return 1; return 1;
} }
else else

View File

@ -118,6 +118,6 @@ int
winMultiWindowGetWMName(WindowPtr pWin, char **wmName); winMultiWindowGetWMName(WindowPtr pWin, char **wmName);
int int
winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy); winMultiWindowGetTransientFor(WindowPtr pWin, Window *ppDaddy);
#endif #endif

View File

@ -486,7 +486,7 @@ winCreateWindowsWindow(WindowPtr pWin)
winWindowPriv(pWin); winWindowPriv(pWin);
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints; WinXSizeHints hints;
WindowPtr pDaddy; Window daddyId;
DWORD dwStyle, dwExStyle; DWORD dwStyle, dwExStyle;
RECT rc; RECT rc;
@ -516,10 +516,10 @@ winCreateWindowsWindow(WindowPtr pWin)
winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
iY); iY);
if (winMultiWindowGetTransientFor(pWin, &pDaddy)) { if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
if (pDaddy) { if (daddyId) {
hFore = GetForegroundWindow(); hFore = GetForegroundWindow();
if (hFore && (pDaddy != (WindowPtr) GetProp(hFore, WIN_WID_PROP))) if (hFore && (daddyId != (Window) GetProp(hFore, WIN_WID_PROP)))
hFore = NULL; hFore = NULL;
} }
} }