diff options
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwndproc.c')
-rw-r--r-- | xorg-server/hw/xwin/winmultiwindowwndproc.c | 86 |
1 files changed, 37 insertions, 49 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c index 543a1652f..3a08f70f1 100644 --- a/xorg-server/hw/xwin/winmultiwindowwndproc.c +++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c @@ -42,6 +42,13 @@ #include "winmsg.h" #include "inputstr.h" +#ifdef XKB +#ifndef XKB_IN_SERVER +#define XKB_IN_SERVER +#endif +#include <xkbsrv.h> +#endif + /* * External global variables */ @@ -282,11 +289,11 @@ static void winRaiseWindow(WindowPtr pWin) if (!winInDestroyWindowsWindow && !winInRaiseWindow) { BOOL oldstate = winInRaiseWindow; + XID vlist[1] = { 0 }; winInRaiseWindow = TRUE; /* Call configure window directly to make sure it gets processed * in time */ - XID vlist[1] = { 0 }; ConfigureWindow(pWin, CWStackMode, vlist, serverClient); winInRaiseWindow = oldstate; } @@ -331,9 +338,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, Bool needRestack = FALSE; LRESULT ret; -#if CYGDEBUG winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam); -#endif /* Check if the Windows window property for our X window pointer is valid */ if ((pWin = GetProp (hwnd, WIN_WINDOW_PROP)) != NULL) @@ -366,38 +371,15 @@ winTopLevelWindowProc (HWND hwnd, UINT message, fWMMsgInitialized = TRUE; -#if 0 - /* - * Print some debugging information - */ - - ErrorF ("hWnd %08X\n", hwnd); - ErrorF ("pWin %08X\n", pWin); - ErrorF ("pDraw %08X\n", pDraw); - ErrorF ("\ttype %08X\n", pWin->drawable.type); - ErrorF ("\tclass %08X\n", pWin->drawable.class); - ErrorF ("\tdepth %08X\n", pWin->drawable.depth); - ErrorF ("\tbitsPerPixel %08X\n", pWin->drawable.bitsPerPixel); - ErrorF ("\tid %08X\n", pWin->drawable.id); - ErrorF ("\tx %08X\n", pWin->drawable.x); - ErrorF ("\ty %08X\n", pWin->drawable.y); - ErrorF ("\twidth %08X\n", pWin->drawable.width); - ErrorF ("\thenght %08X\n", pWin->drawable.height); - ErrorF ("\tpScreen %08X\n", pWin->drawable.pScreen); - ErrorF ("\tserialNumber %08X\n", pWin->drawable.serialNumber); - ErrorF ("g_iWindowPrivateKey %p\n", g_iWindowPrivateKey); - ErrorF ("pWinPriv %08X\n", pWinPriv); - ErrorF ("s_pScreenPriv %08X\n", s_pScreenPriv); - ErrorF ("s_pScreenInfo %08X\n", s_pScreenInfo); - ErrorF ("hwndScreen %08X\n", hwndScreen); -#endif } /* Branch on message type */ switch (message) { case WM_CREATE: - +{ + RECT rWindow; + HRGN hRgnWindow; /* */ SetProp (hwnd, WIN_WINDOW_PROP, @@ -416,15 +398,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message, winReorderWindowsMultiWindow (); /* Fix a 'round title bar corner background should be transparent not black' problem when first painted */ - RECT rWindow; - HRGN hRgnWindow; GetWindowRect(hwnd, &rWindow); hRgnWindow = CreateRectRgnIndirect(&rWindow); SetWindowRgn (hwnd, hRgnWindow, TRUE); DeleteObject(hRgnWindow); - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)XMING_SIGNATURE); - + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)VCXSRV_SIGNATURE); +} return 0; case WM_INIT_SYS_MENU: @@ -739,7 +719,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, if (wParam == VK_F4 && (GetKeyState (VK_MENU) & 0x8000)) break; -#if CYGWINDOWING_DEBUG +#ifdef WINDBG if (wParam == VK_ESCAPE) { /* Place for debug: put any tests and dumps here */ @@ -750,27 +730,27 @@ winTopLevelWindowProc (HWND hwnd, UINT message, windPlace.length = sizeof (WINDOWPLACEMENT); GetWindowPlacement (hwnd, &windPlace); pRect = &windPlace.rcNormalPosition; - ErrorF ("\nCYGWINDOWING Dump:\n" + winDebug ("\nCYGWINDOWING Dump:\n" "\tdrawable: (%hd, %hd) - %hdx%hd\n", pDraw->x, pDraw->y, pDraw->width, pDraw->height); - ErrorF ("\twindPlace: (%ld, %ld) - %ldx%ld\n", pRect->left, + winDebug ("\twindPlace: (%ld, %ld) - %ldx%ld\n", pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top); if (GetClientRect (hwnd, &rc)) { pRect = &rc; - ErrorF ("\tClientRect: (%ld, %ld) - %ldx%ld\n", pRect->left, + winDebug ("\tClientRect: (%ld, %ld) - %ldx%ld\n", pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top); } if (GetWindowRect (hwnd, &rc)) { pRect = &rc; - ErrorF ("\tWindowRect: (%ld, %ld) - %ldx%ld\n", pRect->left, + winDebug ("\tWindowRect: (%ld, %ld) - %ldx%ld\n", pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top); } - ErrorF ("\n"); + winDebug ("\n"); } #endif @@ -845,7 +825,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Branch on if the window was killed in X already */ if (pWinPriv && !pWinPriv->fXKilled) { - ErrorF ("winTopLevelWindowProc - WM_DESTROY - WM_WM_KILL\n"); + winDebug ("winTopLevelWindowProc - WM_DESTROY - WM_WM_KILL\n"); /* Tell our Window Manager thread to kill the window */ wmMsg.msg = WM_WM_KILL; @@ -897,13 +877,11 @@ winTopLevelWindowProc (HWND hwnd, UINT message, } else /* It is an overridden window so make it top of Z stack */ { -#if CYGWINDOWING_DEBUG - ErrorF ("overridden window is shown\n"); -#endif HWND forHwnd = GetForegroundWindow(); + winDebug ("overridden window is shown\n"); if (forHwnd != NULL) { - if (GetWindowLongPtr(forHwnd, GWLP_USERDATA) & (LONG_PTR)XMING_SIGNATURE) + if (GetWindowLongPtr(forHwnd, GWLP_USERDATA) & (LONG_PTR)VCXSRV_SIGNATURE) { if (GetWindowLongPtr(forHwnd, GWL_EXSTYLE) & WS_EX_TOPMOST) SetWindowPos (hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); @@ -989,7 +967,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, case WM_SIZE: /* see dix/window.c */ -#if CYGWINDOWING_DEBUG +#ifdef WINDBG { char buf[64]; switch (wParam) @@ -1006,24 +984,34 @@ winTopLevelWindowProc (HWND hwnd, UINT message, default: strcpy(buf, "UNKNOWN_FLAG"); } - ErrorF ("winTopLevelWindowProc - WM_SIZE to %dx%d (%s) - %d ms\n", + winDebug ("winTopLevelWindowProc - WM_SIZE to %dx%d (%s) - %d ms\n", (int)LOWORD(lParam), (int)HIWORD(lParam), buf, (int)(GetTickCount ())); } #endif /* Adjust the X Window to the moved Windows window */ winAdjustXWindow (pWin, hwnd); + if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow(); return 0; /* end of WM_SIZE handler */ + case WM_STYLECHANGED: + /* when the style changes, adjust the window size so the client area remains the same */ + { + LONG x,y; + DrawablePtr pDraw = &pWin->drawable; + x = pDraw->x - wBorderWidth(pWin); + y = pDraw->y - wBorderWidth(pWin); + winPositionWindowMultiWindow(pWin, x, y); + } + return 0; + case WM_MOUSEACTIVATE: /* Check if this window needs to be made active when clicked */ if (!GetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP)) { -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winTopLevelWindowProc - WM_MOUSEACTIVATE - " + winDebug ("winTopLevelWindowProc - WM_MOUSEACTIVATE - " "MA_NOACTIVATE\n"); -#endif /* */ return MA_NOACTIVATE; |