hw/xwin: Move reshape code from winUpdateWindowPosition() to the map event handler

Move reshape code, which was only used when handling a map event, from
winUpdateWindowPosition(), to put it explicitly in the map event handler.

Remove 'reshape' parameter from winUpdatePosition().

(Note that there's no handling of the ShapeNotify event to notice when the
window shape changes, instead we hook the screen SetShape procedure and reshape
the native window then)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2013-01-10 14:37:45 +00:00
parent 852d1fb042
commit 066ecbd11d
2 changed files with 16 additions and 9 deletions

View File

@ -186,7 +186,7 @@ static void
winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle); winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle);
void void
winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle); winUpdateWindowPosition(HWND hWnd, HWND * zstyle);
/* /*
* Local globals * Local globals
@ -742,8 +742,19 @@ winMultiWindowWMProc(void *pArg)
winApplyHints(pWMInfo->pDisplay, pNode->msg.iWindow, winApplyHints(pWMInfo->pDisplay, pNode->msg.iWindow,
pNode->msg.hwndWindow, &zstyle); pNode->msg.hwndWindow, &zstyle);
winUpdateWindowPosition(pNode->msg.hwndWindow, TRUE, &zstyle); winUpdateWindowPosition(pNode->msg.hwndWindow, &zstyle);
} }
/* Reshape */
{
WindowPtr pWin =
GetProp(pNode->msg.hwndWindow, WIN_WINDOW_PROP);
if (pWin) {
winReshapeMultiWindow(pWin);
winUpdateRgnMultiWindow(pWin);
}
}
break; break;
case WM_WM_UNMAP: case WM_WM_UNMAP:
@ -1749,7 +1760,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
} }
void void
winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle) winUpdateWindowPosition(HWND hWnd, HWND * zstyle)
{ {
int iX, iY, iWidth, iHeight; int iX, iY, iWidth, iHeight;
int iDx, iDy; int iDx, iDy;
@ -1800,8 +1811,4 @@ winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle)
SetWindowPos(hWnd, *zstyle, rcNew.left, rcNew.top, SetWindowPos(hWnd, *zstyle, rcNew.left, rcNew.top,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, 0); rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, 0);
if (reshape) {
winReshapeMultiWindow(pWin);
winUpdateRgnMultiWindow(pWin);
}
} }

View File

@ -42,7 +42,7 @@
#include "winmsg.h" #include "winmsg.h"
#include "inputstr.h" #include "inputstr.h"
extern void winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle); extern void winUpdateWindowPosition(HWND hWnd, HWND * zstyle);
/* /*
* Local globals * Local globals
@ -891,7 +891,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
WS_CLIPCHILDREN | WS_CLIPSIBLINGS) WS_CLIPCHILDREN | WS_CLIPSIBLINGS)
& ~WS_CAPTION & ~WS_SIZEBOX); & ~WS_CAPTION & ~WS_SIZEBOX);
winUpdateWindowPosition(hwnd, FALSE, &zstyle); winUpdateWindowPosition(hwnd, &zstyle);
{ {
WinXWMHints hints; WinXWMHints hints;