diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-07-01 22:27:20 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2015-11-03 17:16:10 +0000 |
commit | e07f7bb0183dde1715617846c38850b48148fbf0 (patch) | |
tree | b7c48df29d82ecfa8e76dda3585c1c2e288033d1 | |
parent | ddec17a124b34de7681bfa4b9d5fafbedbfb7569 (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.c | 5 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 12 |
2 files changed, 5 insertions, 12 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 7df8fce86..d077ca1d2 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -2169,6 +2169,11 @@ winApplyHints(WMInfoPtr pWMInfo, Window 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 d69f600a3..05cfd5929 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); { |