summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2015-07-01 22:27:20 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2016-11-17 13:15:44 +0000
commit4ee45d5e51f33f483705709d2c5e662099cc0807 (patch)
tree3e8cfaa5e4590d9a7c5fa3034773173e5da30ba6
parent6d9eb18358710d0c2567b2534faa46ad19b58239 (diff)
Don't alter window style in WM_SHOWWINDOW
We can do all of the needed window styling in winApplyStyle() The WS_POPUP | WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPBSIBLINGS styles are already set by winCreateWindowsWindow. Make winApplyStyle() set and clear WS_SYSMENU, WS_MAXIMIZEBOX and WS_MINIMIZEBOX as needed. The difference between the transient (WS_OVERLAPPED | WS_SYSMENU) and standard (WS_OVERLAPPEDWINDOW & ~WS_CAPTION & ~WS_SIZEBOX) styles is just (WS_MINIMIZEBOX | WS_MAXIMIZEBOX), both of which are adjusted by winApplyStyle() now.
-rw-r--r--hw/xwin/winmultiwindowwm.c5
-rw-r--r--hw/xwin/winmultiwindowwndproc.c12
2 files changed, 5 insertions, 12 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index b8bdd39c3..93cf889c1 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -2111,6 +2111,11 @@ winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle)
style &= ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */
+ if (GetParent(hWnd))
+ style |= WS_SYSMENU;
+ else
+ style |= WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX;
+
if (!(hint & ~HINT_SKIPTASKBAR)) /* No hints, default */
style = style | WS_CAPTION | WS_SIZEBOX;
else if (hint & HINT_NOFRAME) /* No frame, no decorations */
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 73fc31dab..150201134 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -917,18 +917,6 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Flag that this window needs to be made active when clicked */
SetProp(hwnd, WIN_NEEDMANAGE_PROP, (HANDLE) 1);
- /* Set the transient style flags */
- if (GetParent(hwnd))
- SetWindowLongPtr(hwnd, GWL_STYLE,
- WS_POPUP | WS_OVERLAPPED | WS_SYSMENU |
- WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
- /* Set the window standard style flags */
- else
- SetWindowLongPtr(hwnd, GWL_STYLE,
- (WS_POPUP | WS_OVERLAPPEDWINDOW |
- WS_CLIPCHILDREN | WS_CLIPSIBLINGS)
- & ~WS_CAPTION & ~WS_SIZEBOX);
-
winUpdateWindowPosition(hwnd, &zstyle);
{