Preserve WM hints that were set during window creation by calling

XGetWMHints prior to XSetWMHints.
This commit is contained in:
Susan Farley 2000-06-02 20:36:29 +00:00 committed by Alexandre Julliard
parent e5e2fc9999
commit 8037389c49
4 changed files with 25 additions and 8 deletions

View File

@ -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*);

View File

@ -75,6 +75,7 @@ XGetModifierMapping
XGetScreenSaver
XGetSelectionOwner
XGetVisualInfo
XGetWMHints
XGetWMSizeHints
XGetWindowAttributes
XGetWindowProperty

View File

@ -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;

View File

@ -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 )