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-11 11:56:32 +0000 |
commit | 4cd600b92d5e46d31b60c6f0228557eb0d025532 (patch) | |
tree | 2cfe6c65b144475683296eaa8f65b1a24cfc9054 /hw | |
parent | 59880d396dd1c4da8f2014aa8a30e57b869a3db1 (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.
Diffstat (limited to 'hw')
-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 d0b203b11..12ad5804e 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -2155,6 +2155,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 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); { |