? rootless.patch Index: InitOutput.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/InitOutput.c,v retrieving revision 1.29 diff -u -r1.29 InitOutput.c --- InitOutput.c 2002/07/05 09:19:25 1.29 +++ InitOutput.c 2002/10/11 12:27:19 @@ -42,6 +42,7 @@ int g_iCmapPrivateIndex = -1; int g_iGCPrivateIndex = -1; int g_iPixmapPrivateIndex = -1; +int g_iWindowPrivateIndex = -1; unsigned long g_ulServerGeneration = 0; Bool g_fInitializedDefaultScreens = FALSE; FILE *g_pfLog = NULL; Index: win.h =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/win.h,v retrieving revision 1.30 diff -u -r1.30 win.h --- win.h 2002/07/05 09:19:25 1.30 +++ win.h 2002/10/11 12:27:22 @@ -53,7 +53,7 @@ #define WIN_UPDATE_STATS NO /* Turn debug messages on or off */ -#define CYGDEBUG NO +#define CYGDEBUG YES /* Constant strings */ #define WINDOW_CLASS "cygwin/xfree86" @@ -61,6 +61,9 @@ #define WIN_SCR_PROP "cyg_screen_prop" #define WIN_MSG_QUEUE_FNAME "/dev/windows" #define WIN_LOG_FNAME "/tmp/XWin.log" +#define WINDOWX_CLASS "cygwin/xfree86X" +#define WINDOWX_TITLE "Cygwin/XFree86X" +#define WIN_WIN_PROP "cyg_window_prop" #define NEED_EVENTS @@ -188,6 +191,7 @@ */ #include "winms.h" +#undef CreateWindow /* Cygwin's winuser.h does not define VK_KANA as of 28Mar2001 */ /* NOTE: Cygwin's winuser.h was fixed shortly after 28Mar2001. */ @@ -473,10 +477,32 @@ winCreateColormapProcPtr pwinCreateColormap; winDestroyColormapProcPtr pwinDestroyColormap; winHotKeyAltTabPtr pwinHotKeyAltTab; + /* Rootless mode */ + CreateWindowProcPtr CreateWindow; + DestroyWindowProcPtr DestroyWindow; + RealizeWindowProcPtr RealizeWindow; + UnrealizeWindowProcPtr UnrealizeWindow; + MoveWindowProcPtr MoveWindow; + ResizeWindowProcPtr ResizeWindow; + RestackWindowProcPtr RestackWindow; + ChangeBorderWidthProcPtr ChangeBorderWidth; + PositionWindowProcPtr PositionWindow; + ChangeWindowAttributesProcPtr ChangeWindowAttributes; } winPrivScreenRec, *winPrivScreenPtr; /* + * Screen privates + */ + +typedef struct +{ + Bool fTopLevel; + HWND hwndWin; +} winPrivWindowRec, *winPrivWindowPtr; + + +/* * Extern declares for general global variables */ @@ -485,6 +511,7 @@ extern DWORD g_dwEvents; extern int g_fdMessageQueue; extern int g_iScreenPrivateIndex; +extern int g_iWindowPrivateIndex; extern int g_iCmapPrivateIndex; extern int g_iGCPrivateIndex; extern int g_iPixmapPrivateIndex; @@ -563,11 +590,17 @@ /* * Window privates macros */ + +#define winGetWindowPriv(pWin) \ + ((winPrivWindowPtr) (pWin)->devPrivates[g_iWindowPrivateIndex].ptr) -#define winGetWindowPrivate(_pWin) ((winPrivWin *)\ - (_pWin)->devPrivates[winWindowPrivateIndex].ptr) +#define winSetWindowPriv(pWin,v) \ + ((pWin)->devPrivates[g_iWindowPrivateIndex].ptr = (pointer) v) +#define winWindowPriv(pWin) \ + winPrivWindowPtr pWindowPriv = winGetWindowPriv(pWin) + /* * FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers. * Has been fixed after May 05, 2001. Remove this section after the @@ -609,6 +642,8 @@ Bool winAllocateCmapPrivates (ColormapPtr pCmap); +Bool +winAllocateWindowPrivates (WindowPtr pWin); /* * winblock.c Index: winallpriv.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winallpriv.c,v retrieving revision 1.10 diff -u -r1.10 winallpriv.c --- winallpriv.c 2002/07/05 09:19:26 1.10 +++ winallpriv.c 2002/10/11 12:27:23 @@ -60,6 +60,7 @@ g_iScreenPrivateIndex = AllocateScreenPrivateIndex (); g_iGCPrivateIndex = AllocateGCPrivateIndex (); g_iPixmapPrivateIndex = AllocatePixmapPrivateIndex (); + g_iWindowPrivateIndex = AllocateWindowPrivateIndex (); g_ulServerGeneration = serverGeneration; } @@ -94,6 +95,14 @@ sizeof (winPrivPixmapRec))) { ErrorF ("winAllocatePrivates () - AllocatePixmapPrivates () failed\n"); + return FALSE; + } + + /* Reserve Window memory for our privates */ + if (!AllocateWindowPrivate (pScreen, g_iWindowPrivateIndex, + sizeof (winPrivWindowRec))) + { + ErrorF ("winAllocatePrivates () - AllocateWindowPrivate () failed\n"); return FALSE; } Index: winblock.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winblock.c,v retrieving revision 1.4 diff -u -r1.4 winblock.c --- winblock.c 2001/11/21 08:51:24 1.4 +++ winblock.c 2002/10/11 12:27:23 @@ -42,7 +42,8 @@ MSG msg; /* Process all messages on our queue */ - while (PeekMessage (&msg, pScreenPriv->hwndScreen, 0, 0, PM_REMOVE)) + /*while (PeekMessage (&msg, pScreenPriv->hwndScreen, 0, 0, PM_REMOVE))*/ + while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { DispatchMessage (&msg); } Index: wincreatewnd.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/wincreatewnd.c,v retrieving revision 1.3 diff -u -r1.3 wincreatewnd.c --- wincreatewnd.c 2002/07/05 09:19:26 1.3 +++ wincreatewnd.c 2002/10/11 12:27:24 @@ -85,7 +85,7 @@ (HMENU) NULL, /* No menu */ GetModuleHandle (NULL),/* Instance handle */ pScreenPriv); /* ScreenPrivates */ - +#if 0 /* Branch on the server engine */ switch (pScreenInfo->dwEngine) { @@ -99,12 +99,14 @@ ShowWindow (*phwnd, SW_SHOWNORMAL); break; } - +#endif + /* Send first paint message */ UpdateWindow (*phwnd); - +#if 0 /* Attempt to bring our window to the top of the display */ BringWindowToTop (*phwnd); +#endif return TRUE; } Index: winscrinit.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winscrinit.c,v retrieving revision 1.23 diff -u -r1.23 winscrinit.c --- winscrinit.c 2002/07/05 09:19:26 1.23 +++ winscrinit.c 2002/10/11 12:27:28 @@ -34,7 +34,6 @@ #include "win.h" - /* * Determine what type of screen we are initializing * and call the appropriate procedure to intiailize @@ -353,6 +352,36 @@ return FALSE; } } +#endif + +#if 1 +#define WRAP(a) \ + if (pScreen->a) { \ + pScreenPriv->a = pScreen->a; \ + } else { \ + ErrorF("null screen fn " #a "\n"); \ + pScreenPriv->a = NULL; \ + } + + WRAP(CreateWindow); + WRAP(DestroyWindow); + WRAP(RealizeWindow); + WRAP(UnrealizeWindow); + WRAP(MoveWindow); + WRAP(PositionWindow); + WRAP(ResizeWindow); + WRAP(RestackWindow); + WRAP(ChangeBorderWidth); + WRAP(ChangeWindowAttributes); + + /* Window Procedures */ + pScreen->CreateWindow = winCreateWindowNativeGDI; + pScreen->DestroyWindow = winDestroyWindowNativeGDI; + pScreen->PositionWindow = winPositionWindowNativeGDI; + pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI; + pScreen->RealizeWindow = winMapWindowNativeGDI; + pScreen->UnrealizeWindow = winUnmapWindowNativeGDI;/**/ +#undef WRAP #endif /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */ Index: winshadgdi.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winshadgdi.c,v retrieving revision 1.20 diff -u -r1.20 winshadgdi.c --- winshadgdi.c 2002/07/05 09:19:27 1.20 +++ winshadgdi.c 2002/10/11 12:27:32 @@ -196,6 +196,19 @@ return fReturn; } +BOOL CALLBACK RedrawAllProc (HWND hwnd, LPARAM lParam) +{ + char strClassName[100]; + if ( GetClassName(hwnd, strClassName, 100)) + { + if(strcmp(WINDOWX_CLASS, strClassName) == 0) + { + InvalidateRect(hwnd, NULL, FALSE); + UpdateWindow(hwnd); + } + } + return TRUE; +} /* * Allocate a DIB for the shadow framebuffer GDI server @@ -335,10 +348,10 @@ static DWORD s_dwTotalUpdates = 0; static DWORD s_dwTotalBoxes = 0; #endif - +#if 0 /* Return immediately if the app is not active and we are fullscreen */ if (!pScreenPriv->fActive && pScreenInfo->fFullScreen) return; - +#endif #if WIN_UPDATE_STATS ++s_dwTotalUpdates; s_dwTotalBoxes += dwBox; @@ -424,6 +437,7 @@ /* Reset the clip region */ SelectClipRgn (pScreenPriv->hdcScreen, NULL); } + EnumWindows(RedrawAllProc, 0); } @@ -710,6 +724,7 @@ /* EndPaint frees the DC */ EndPaint (pScreenPriv->hwndScreen, &ps); + EnumWindows(RedrawAllProc, 0); return TRUE; } @@ -728,7 +743,7 @@ #if CYGDEBUG ErrorF ("winActivateAppShadowGDI\n"); #endif - +#if 0 /* * Are we active? * Are we fullscreen? @@ -751,7 +766,7 @@ */ ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE); } - +#endif #if CYGDEBUG ErrorF ("winActivateAppShadowGDI - Returning\n"); #endif @@ -759,7 +774,6 @@ return TRUE; } - /* * Reblit the shadow framebuffer to the screen. */ @@ -777,7 +791,7 @@ pScreenPriv->hdcShadow, 0, 0, SRCCOPY); - + EnumWindows(RedrawAllProc, 0); return TRUE; } @@ -881,6 +895,7 @@ /* Save a pointer to the newly installed colormap */ pScreenPriv->pcmapInstalled = pColormap; + EnumWindows(RedrawAllProc, 0); return TRUE; } Index: winwakeup.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winwakeup.c,v retrieving revision 1.5 diff -u -r1.5 winwakeup.c --- winwakeup.c 2001/11/21 08:51:24 1.5 +++ winwakeup.c 2002/10/11 12:27:33 @@ -45,7 +45,8 @@ MSG msg; /* Process all messages on our queue */ - while (PeekMessage (&msg, pScreenPriv->hwndScreen, 0, 0, PM_REMOVE)) + /*while (PeekMessage (&msg, pScreenPriv->hwndScreen, 0, 0, PM_REMOVE))*/ + while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { DispatchMessage (&msg); } Index: winwindow.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winwindow.c,v retrieving revision 1.2 diff -u -r1.2 winwindow.c --- winwindow.c 2001/06/04 13:04:41 1.2 +++ winwindow.c 2002/10/11 12:27:35 @@ -31,12 +31,324 @@ #include "win.h" +LRESULT CALLBACK +winXWindowProc (HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam) +{ + POINT ptMouse; + HDC hdcUpdate; + RECT rcClient; + PAINTSTRUCT ps; + WindowPtr pWin = NULL; + winPrivWindowPtr pWinPriv = NULL; + ScreenPtr pScreen = NULL; + winPrivScreenPtr pScreenPriv = NULL; + winScreenInfo *pScreenInfo = NULL; + HWND hwndScreen = NULL; + DrawablePtr pDraw = NULL; + int iScanCode; + int i; + + if ((pWin = GetProp (hwnd, WIN_WIN_PROP)) != NULL) + { + pScreen = pWin->drawable.pScreen; + pScreenPriv = winGetScreenPriv(pScreen); + pScreenInfo = pScreenPriv->pScreenInfo; + hwndScreen = pScreenPriv->hwndScreen; + pDraw = &pWin->drawable; + } + + switch (message) + { + case WM_CREATE: + SetProp (hwnd, WIN_WIN_PROP, ((LPCREATESTRUCT) lParam)->lpCreateParams); + return 0; + + case WM_PAINT: + ErrorF ("winXWindowProc()WM_PAINT\n"); + //SendMessage(hwndScreen, message, wParam, lParam); + + if(hwndScreen != NULL) + { + hdcUpdate = BeginPaint (hwnd, &ps); + GetClientRect (hwnd, &rcClient); + ErrorF("ClientRect %d, %d - %d, %d\n", rcClient.left, rcClient.top, + rcClient.right, rcClient.bottom); + if(!BitBlt (hdcUpdate, + 0, 0, + pDraw->width, + pDraw->height, + pScreenPriv->hdcShadow, + pDraw->x, pDraw->y, +/* + rcClient.right - rcClient.left, + rcClient.bottom - rcClient.top, + pScreenPriv->hdcShadow, + rcClient.left, rcClient.top, +*/ + SRCCOPY)) + { + LPVOID lpMsgBuf; + + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, + 0, NULL); + + ErrorF("BitBltFailed %s\n", (LPSTR)lpMsgBuf); + LocalFree( lpMsgBuf ); + } + EndPaint (hwndScreen, &ps); + } + return 0; + + case WM_PALETTECHANGED: + ErrorF ("winXWindowProc()WM_PALETTECHANGED\n"); + /* Redraw the screen */ + SendMessage(hwndScreen, message, wParam, lParam); + return 0; +#if 1 + case WM_MOUSEMOVE: + case WM_NCMOUSEMOVE: + case WM_MOUSELEAVE: + case WM_LBUTTONDBLCLK: + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MBUTTONDBLCLK: + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + case WM_RBUTTONDBLCLK: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: + ErrorF ("winXWindowProc()WM_*BUTTON*\n"); + ptMouse.x = GET_X_LPARAM(lParam); + ptMouse.y = GET_Y_LPARAM(lParam), + ClientToScreen(hwnd, &ptMouse); + //ScreenToClient(hwndScreen, &ptMouse); + SendMessage(hwndScreen, message, wParam, MAKELONG(ptMouse.x, ptMouse.y)); + return DefWindowProc (hwnd, message, wParam, lParam); + case WM_MOUSEWHEEL: + ErrorF ("winXWindowProc()WM_MOUSEWHEEL\n"); + SendMessage(hwndScreen, message, wParam, lParam); + return 0; +#if 0 + case WM_SETFOCUS: + case WM_KILLFOCUS: + ErrorF ("winXWindowProc()WM_*FORCUS\n"); + SendMessage(hwndScreen, message, wParam, lParam); + return 0; +#endif +#if 1 + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + case WM_SYSKEYUP: + case WM_KEYUP: + case WM_DEADCHAR: + case WM_SYSDEADCHAR: + ErrorF ("winXWindowProc()WM_*KEY*\n"); + SendMessage(hwndScreen, message, wParam, lParam); + return 0; + + case WM_HOTKEY: + ErrorF ("winXWindowProc()WM_HOTKEY\n"); + SendMessage(hwndScreen, message, wParam, lParam); + return 0; +#else +#if WIN_NEW_KEYBOARD_SUPPORT + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + case WM_SYSKEYUP: + case WM_KEYUP: + if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput) + break; + + /* Don't process keys if we are not active */ + /*if (!pScreenPriv->fActive) + return 0;*/ + + winProcessKeyEvent ((DWORD)wParam, (DWORD) lParam); + return 0; + + case WM_DEADCHAR: + case WM_SYSDEADCHAR: + return 0; + +#else /* WIN_NEW_KEYBOARD_SUPPORT */ + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput) + break; + + ErrorF ("winXWindowProc()WM_*KEYDOWN\n"); + /* + * FIXME: Catching Alt-F4 like this is really terrible. This should + * be generalized to handle other Windows keyboard signals. Actually, + * the list keys to catch and the actions to perform when caught should + * be configurable; that way user's can customize the keys that they + * need to have passed through to their window manager or apps, or they + * can remap certain actions to new key codes that do not conflict + * with the X apps that they are using. Yeah, that'll take awhile. + */ + if ((pScreenInfo->fUseWinKillKey && wParam == VK_F4 + && (GetKeyState (VK_MENU) & 0x8000)) + || (pScreenInfo->fUseUnixKillKey && wParam == VK_BACK + && (GetKeyState (VK_MENU) & 0x8000) + && (GetKeyState (VK_CONTROL) & 0x8000))) + { + /* + * Better leave this message here, just in case some unsuspecting + * user enters Alt + F4 and is surprised when the application + * quits. + */ + ErrorF ("winWindowProc - WM_*KEYDOWN - Closekey hit, quitting\n"); + + /* Tell our message queue to give up */ + PostMessage (hwnd, WM_CLOSE, 0, 0); + return 0; + } + + /* + * Don't do anything for the Windows keys, as focus will soon + * be returned to Windows. We may be able to trap the Windows keys, + * but we should determine if that is desirable before doing so. + */ + if (wParam == VK_LWIN || wParam == VK_RWIN) + break; + + /* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */ + if (winIsFakeCtrl_L (message, wParam, lParam)) + return 0; + + /* Send the key event(s) */ + winTranslateKey (wParam, lParam, &iScanCode); + for (i = 0; i < LOWORD(lParam); ++i) + winSendKeyEvent (iScanCode, TRUE); + return 0; + + case WM_SYSKEYUP: + case WM_KEYUP: + if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput) + break; + + ErrorF ("winXWindowProc()WM_*KEYUP\n"); + /* + * Don't do anything for the Windows keys, as focus will soon + * be returned to Windows. We may be able to trap the Windows keys, + * but we should determine if that is desirable before doing so. + */ + if (wParam == VK_LWIN || wParam == VK_RWIN) + break; + + /* Ignore the fake Ctrl_L that follows an AltGr release */ + if (winIsFakeCtrl_L (message, wParam, lParam)) + return 0; + + /* Enqueue a keyup event */ + winTranslateKey (wParam, lParam, &iScanCode); + winSendKeyEvent (iScanCode, FALSE); + return 0; +#endif /* WIN_NEW_KEYBOARD_SUPPORT */ + + case WM_HOTKEY: + if (pScreenPriv == NULL) + break; + + /* Call the engine-specific hot key handler */ + (*pScreenPriv->pwinHotKeyAltTab) (pScreen); + return 0; +#endif + case WM_ACTIVATE: + ErrorF ("winXWindowProc()WM_ACTIVATE\n"); + //SendMessage(hwndScreen, message, wParam, lParam); + return 0; + + case WM_ACTIVATEAPP: + ErrorF ("winXWindowProc()WM_ACTIVATEAPP\n"); + //SendMessage(hwndScreen, message, wParam, lParam); + return 0; + +#endif + case WM_DESTROY: + ErrorF ("winXWindowProc()WM_DESTROY\n"); + PostQuitMessage(0); + return 0; + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} /* See Porting Layer Definition - p. 37 */ /* See mfb/mfbwindow.c - mfbCreateWindow() */ Bool winCreateWindowNativeGDI (WindowPtr pWin) { + WNDCLASS wc; + int iWidth; + int iHeight; + RECT rcClient, rcWorkArea; + DWORD dwWindowStyle; + winPrivWindowPtr pWinPriv; + ErrorF ("winCreateWindow()\n"); + pWinPriv = winGetWindowPriv(pWin); + ErrorF ("pWinPriv %x\n", pWinPriv); + + winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow(pWin); + + if((pWin->parent!=NULL)&&(pWin->parent->parent==NULL)){ + ErrorF ("winCreateWindow() TopLevel\n"); + + pWinPriv->fTopLevel = TRUE; + + rcWorkArea.left = pWin->borderSize.extents.x1; + rcWorkArea.right = pWin->borderSize.extents.x2; + rcWorkArea.top = pWin->borderSize.extents.y1; + rcWorkArea.bottom = pWin->borderSize.extents.y2; + + iWidth = rcWorkArea.right - rcWorkArea.left; + iHeight = rcWorkArea.bottom - rcWorkArea.top; + /* Initialize window style */ + dwWindowStyle = WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX; + + /*dwWindowStyle |= WS_CAPTION;*/ + dwWindowStyle |= WS_POPUP; + + /* Setup our window class */ + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = winXWindowProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandle (NULL); + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); + wc.lpszMenuName = NULL; + wc.lpszClassName = WINDOWX_CLASS; + RegisterClass (&wc); + /* Create the window */ + pWinPriv->hwndWin = CreateWindowExA (0, /* Extended styles */ + WINDOWX_CLASS, /* Class name */ + WINDOWX_TITLE, /* Window name */ + dwWindowStyle, + rcWorkArea.left, /* Horizontal position */ + rcWorkArea.top, /* Vertical position */ + iWidth, /* Right edge */ + iHeight, /* Bottom edge */ + (HWND) NULL, /* No parent or owner window */ + (HMENU) NULL, /* No menu */ + GetModuleHandle (NULL),/* Instance handle */ + pWin); /* WindowPrivates */ + + ErrorF ("CreateWindowEx() return %d\n", pWinPriv->hwndWin); + }else{ + pWinPriv->fTopLevel = FALSE; + pWinPriv->hwndWin = 0; + } + ErrorF ("-winCreateWindow()\n"); return TRUE; } @@ -45,7 +357,16 @@ Bool winDestroyWindowNativeGDI (WindowPtr pWin) { + winPrivWindowPtr pWinPriv = winGetWindowPriv(pWin); + ErrorF ("winDestroyWindow()\n"); + + winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow(pWin); + + if(pWinPriv->fTopLevel){ + DestroyWindow(pWinPriv->hwndWin); + } + ErrorF ("-winDestroyWindow()\n"); return TRUE; } @@ -54,7 +375,30 @@ Bool winPositionWindowNativeGDI (WindowPtr pWin, int x, int y) { + int iWidth; + int iHeight; + int iX; + int iY; + winPrivWindowPtr pWinPriv; + ErrorF ("winPositionWindow()\n"); + winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow(pWin, x, y); + + pWinPriv = winGetWindowPriv(pWin); + ErrorF ("pWinPriv %x\n", pWinPriv); + + if(pWinPriv->fTopLevel){ + ErrorF ("winCreateWindow() TopLevel\n"); + + iX = pWin->borderSize.extents.x1; + iY = pWin->borderSize.extents.y1; + + iWidth = pWin->borderSize.extents.x2 - pWin->borderSize.extents.x1; + iHeight = pWin->borderSize.extents.y2 - pWin->borderSize.extents.y1; + + MoveWindow(pWinPriv->hwndWin, iX, iY, iWidth, iHeight, TRUE); + } + ErrorF ("-winPositionWindow()\n"); return TRUE; } @@ -74,6 +418,7 @@ winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask) { ErrorF ("winChangeWindowAttributes()\n"); + winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes(pWin, mask); return TRUE; } @@ -83,10 +428,18 @@ Bool winUnmapWindowNativeGDI (WindowPtr pWindow) { + winPrivWindowPtr pWinPriv = winGetWindowPriv(pWindow); + winGetScreenPriv(pWindow->drawable.pScreen)->UnrealizeWindow(pWindow); + ErrorF ("winUnmapWindow()\n"); + ErrorF ("pWinPriv %x\n", pWinPriv); + + if(pWinPriv->fTopLevel) + ShowWindow (pWinPriv->hwndWin, SW_HIDE); /* This functions is empty in the CFB, * we probably won't need to do anything */ + ErrorF ("-winUnmapWindow()\n"); return TRUE; } @@ -96,9 +449,16 @@ Bool winMapWindowNativeGDI (WindowPtr pWindow) { + winPrivWindowPtr pWinPriv = winGetWindowPriv(pWindow); + winGetScreenPriv(pWindow->drawable.pScreen)->RealizeWindow(pWindow); ErrorF ("winMapWindow()\n"); + ErrorF ("pWinPriv %x\n", pWinPriv); + + if(pWinPriv->fTopLevel) + ShowWindow (pWinPriv->hwndWin, SW_SHOWNORMAL); /* This function is empty in the CFB, * we probably won't need to do anything */ + ErrorF ("-winMapWindow()\n"); return TRUE; } Index: winwndproc.c =================================================================== RCS file: /cvs/xc/programs/Xserver/hw/xwin/winwndproc.c,v retrieving revision 1.22 diff -u -r1.22 winwndproc.c --- winwndproc.c 2002/07/05 09:19:27 1.22 +++ winwndproc.c 2002/10/11 12:27:36 @@ -318,7 +318,7 @@ /* Release any pressed keys */ winKeybdReleaseKeys (); return 0; - +#if 1 #if WIN_NEW_KEYBOARD_SUPPORT case WM_SYSKEYDOWN: case WM_KEYDOWN: @@ -419,7 +419,7 @@ /* Call the engine-specific hot key handler */ (*s_pScreenPriv->pwinHotKeyAltTab) (s_pScreen); return 0; - +#endif case WM_ACTIVATE: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break;