mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 12:38:03 +02: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)
|
winWin32RootlessReshapeFrame (RootlessFrameID wid, RegionPtr pShape)
|
||||||
{
|
{
|
||||||
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
|
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
|
||||||
HRGN hRgn;
|
HRGN hRgn, hRgnWindow, hRgnClient;
|
||||||
|
RECT rcWindow, rcClient;
|
||||||
|
POINT ptOffset;
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ErrorF ("winWin32RootlessReshapeFrame (%08x)\n", (int) pRLWinPriv);
|
ErrorF ("winWin32RootlessReshapeFrame (%08x)\n", (int) pRLWinPriv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hRgn = winWin32RootlessCreateRgnFromRegion (pShape);
|
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);
|
SetWindowRgn (pRLWinPriv->hWnd, hRgn, TRUE);
|
||||||
|
|
||||||
|
DeleteObject (hRgnWindow);
|
||||||
|
DeleteObject (hRgnClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,8 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
|
||||||
win32RootlessWindowPtr pRLWinPriv;
|
win32RootlessWindowPtr pRLWinPriv;
|
||||||
RECT rcNew;
|
RECT rcNew;
|
||||||
WINDOWPLACEMENT wndpl;
|
WINDOWPLACEMENT wndpl;
|
||||||
|
RegionRec newShape;
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
|
REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
|
||||||
|
|
||||||
|
|
@ -506,6 +508,18 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
|
||||||
|
|
||||||
winWin32RootlessUpdateIcon (pWin->drawable.id);
|
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
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ErrorF ("ProcWindowsWMFrameDraw - done\n");
|
ErrorF ("ProcWindowsWMFrameDraw - done\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue