diff --git a/graphics/x11drv/palette.c b/graphics/x11drv/palette.c index fb7770005f3..a60cbe010f3 100644 --- a/graphics/x11drv/palette.c +++ b/graphics/x11drv/palette.c @@ -394,10 +394,6 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) TRACE("Dynamic colormap... \n"); - /* comment this out if you want to debug palette init */ - - TSXGrabServer(display); - /* let's become the first client that actually follows * X guidelines and does binary search... */ @@ -406,6 +402,10 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) WARN("Out of memory while building system palette.\n"); return FALSE; } + + /* comment this out if you want to debug palette init */ + TSXGrabServer(display); + while( c_max - c_min > 0 ) { c_val = (c_max + c_min)/2 + (c_max + c_min)%2; diff --git a/windows/nonclient.c b/windows/nonclient.c index 7501c396b2f..f61d82e2b65 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -88,7 +88,7 @@ static const BYTE lpGrayMask[] = { 0xAA, 0xA0, * WIN_WindowNeedsWMBorder * * This method defines the rules for a window to have a WM border, - * caption... It is used for consitency purposes. + * caption... It is used for consistency purposes. */ BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle ) { @@ -2107,11 +2107,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) hdc = GetDCEx( wndPtr->parent->hwndSelf, 0, DCX_CACHE ); } else - { /* Grab the server only when moving top-level windows without desktop */ hdc = GetDC( 0 ); - } - - wndPtr->pDriver->pPreSizeMove(wndPtr); if( iconic ) /* create a cursor for dragging */ { @@ -2121,6 +2117,8 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) if( !hDragCursor ) iconic = FALSE; } + wndPtr->pDriver->pPreSizeMove(wndPtr); + /* invert frame if WIN31_LOOK to indicate mouse click on caption */ if( !iconic && TWEAK_WineLook == WIN31_LOOK ) if(!DragFullWindows) @@ -2695,7 +2693,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT pt ) TRACE("Handling WM_SYSCOMMAND %x %ld,%ld\n", wParam, pt.x, pt.y ); - if (wndPtr->dwStyle & WS_CHILD && uCommand != SC_KEYMENU ) + if ((wndPtr->dwStyle & WS_CHILD) && (uCommand != SC_KEYMENU)) ScreenToClient( wndPtr->parent->hwndSelf, &pt ); switch (uCommand) diff --git a/windows/x11drv/wnd.c b/windows/x11drv/wnd.c index b858d4dd261..c0cdc103426 100644 --- a/windows/x11drv/wnd.c +++ b/windows/x11drv/wnd.c @@ -852,6 +852,7 @@ void X11DRV_WND_SetFocus(WND *wndPtr) */ void X11DRV_WND_PreSizeMove(WND *wndPtr) { + /* Grab the server only when moving top-level windows without desktop */ if (!(wndPtr->dwStyle & WS_CHILD) && (X11DRV_GetXRootWindow() == DefaultRootWindow(display))) TSXGrabServer( display ); }