mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-30 09:40:08 +01:00
Add shape extnsion for multi-window window manager.
This commit is contained in:
parent
c8ae2f1135
commit
861da6546c
2 changed files with 35 additions and 1 deletions
|
|
@ -540,12 +540,32 @@ void
|
|||
winWin32RootlessReshapeFrame (RootlessFrameID wid, RegionPtr pShape)
|
||||
{
|
||||
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
|
||||
HRGN hRgn;
|
||||
HRGN hRgn, hRgnWindow, hRgnClient;
|
||||
RECT rcWindow, rcClient;
|
||||
POINT ptOffset;
|
||||
#if CYGMULTIWINDOW_DEBUG
|
||||
ErrorF ("winWin32RootlessReshapeFrame (%08x)\n", (int) pRLWinPriv);
|
||||
#endif
|
||||
|
||||
hRgn = winWin32RootlessCreateRgnFromRegion (pShape);
|
||||
|
||||
/* Create region for non-client area */
|
||||
GetWindowRect (pRLWinPriv->hWnd, &rcWindow);
|
||||
GetClientRect (pRLWinPriv->hWnd, &rcClient);
|
||||
MapWindowPoints (pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);
|
||||
OffsetRgn (hRgn, rcClient.left - rcWindow.left, rcClient.top - rcWindow.top);
|
||||
OffsetRect (&rcClient, -rcWindow.left, -rcWindow.top);
|
||||
OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
|
||||
hRgnWindow = CreateRectRgnIndirect (&rcWindow);
|
||||
hRgnClient = CreateRectRgnIndirect (&rcClient);
|
||||
CombineRgn (hRgnWindow, hRgnWindow, hRgnClient, RGN_DIFF);
|
||||
CombineRgn (hRgn, hRgnWindow, hRgn, RGN_OR);
|
||||
|
||||
|
||||
SetWindowRgn (pRLWinPriv->hWnd, hRgn, TRUE);
|
||||
|
||||
DeleteObject (hRgnWindow);
|
||||
DeleteObject (hRgnClient);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -440,6 +440,8 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
|
|||
win32RootlessWindowPtr pRLWinPriv;
|
||||
RECT rcNew;
|
||||
WINDOWPLACEMENT wndpl;
|
||||
RegionRec newShape;
|
||||
ScreenPtr pScreen;
|
||||
|
||||
REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
|
||||
|
||||
|
|
@ -506,6 +508,18 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
|
|||
|
||||
winWin32RootlessUpdateIcon (pWin->drawable.id);
|
||||
|
||||
if (wBoundingShape(pWin) != NULL)
|
||||
{
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
/* wBoundingShape is relative to *inner* origin of window.
|
||||
Translate by borderWidth to get the outside-relative position. */
|
||||
|
||||
REGION_NULL(pScreen, &newShape);
|
||||
REGION_COPY(pScreen, &newShape, wBoundingShape(pWin));
|
||||
REGION_TRANSLATE(pScreen, &newShape, pWin->borderWidth, pWin->borderWidth);
|
||||
winWin32RootlessReshapeFrame (pRLWinPriv, &newShape);
|
||||
REGION_UNINIT(pScreen, &newShape);
|
||||
}
|
||||
#if CYGMULTIWINDOW_DEBUG
|
||||
ErrorF ("ProcWindowsWMFrameDraw - done\n");
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue