Commit 8037389c authored by Susan Farley's avatar Susan Farley Committed by Alexandre Julliard

Preserve WM hints that were set during window creation by calling

XGetWMHints prior to XSetWMHints.
parent e5e2fc99
......@@ -27,6 +27,7 @@ extern int TSXEmptyRegion(Region);
extern int TSXEqualRegion(Region, Region);
extern int TSXFindContext(Display*, XID, XContext, XPointer*);
extern XVisualInfo * TSXGetVisualInfo(Display*, long, XVisualInfo*, int*);
extern XWMHints * TSXGetWMHints(Display*, Window);
extern int TSXGetWMSizeHints(Display*, Window, XSizeHints*, long*, Atom);
extern int TSXIntersectRegion(Region, Region, Region);
extern int TSXLookupString(XKeyEvent*, char*, int, KeySym*, XComposeStatus*);
......
......@@ -75,6 +75,7 @@ XGetModifierMapping
XGetScreenSaver
XGetSelectionOwner
XGetVisualInfo
XGetWMHints
XGetWMSizeHints
XGetWindowAttributes
XGetWindowProperty
......
......@@ -138,6 +138,17 @@ XVisualInfo * TSXGetVisualInfo(Display* a0, long a1, XVisualInfo* a2, int* a3)
return r;
}
XWMHints * TSXGetWMHints(Display* a0, Window a1)
{
XWMHints * r;
TRACE("Call XGetWMHints\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XGetWMHints(a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XGetWMHints\n");
return r;
}
int TSXGetWMSizeHints(Display* a0, Window a1, XSizeHints* a2, long* a3, Atom a4)
{
int r;
......
......@@ -249,12 +249,14 @@ static void X11DRV_WND_UpdateIconHints(WND *wndPtr)
X11DRV_WND_IconChanged(wndPtr);
wm_hints = TSXAllocWMHints();
X11DRV_WND_SetIconHints(wndPtr, wm_hints);
TSXSetWMHints( display, X11DRV_WND_GetXWindow(wndPtr), wm_hints );
TSXFree( wm_hints );
wm_hints = TSXGetWMHints( display, X11DRV_WND_GetXWindow(wndPtr) );
if (!wm_hints) wm_hints = TSXAllocWMHints();
if (wm_hints)
{
X11DRV_WND_SetIconHints(wndPtr, wm_hints);
TSXSetWMHints( display, X11DRV_WND_GetXWindow(wndPtr), wm_hints );
TSXFree( wm_hints );
}
}
......@@ -362,7 +364,7 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
WIN_ReleaseWndPtr(tmpWnd);
}
wm_hints = TSXAllocWMHints();
if ((wm_hints = TSXAllocWMHints()))
{
wm_hints->flags = InputHint | StateHint | WindowGroupHint;
wm_hints->input = True;
......@@ -831,7 +833,9 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, DC *dc, WORD flags, BOOL bSetClipOrigin
*/
static BOOL X11DRV_SetWMHint(Display* display, WND* wndPtr, int hint, int val)
{
XWMHints* wm_hints = TSXAllocWMHints();
XWMHints* wm_hints = TSXGetWMHints( display, X11DRV_WND_GetXWindow(wndPtr) );
if (!wm_hints) wm_hints = TSXAllocWMHints();
if (wm_hints)
{
wm_hints->flags = hint;
switch( hint )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment