Skip to content

Commit

Permalink
hw/xwin: Stop assuming WS_EX_APPWINDOW style in WM_SHOWWINDOW
Browse files Browse the repository at this point in the history
Signed-off-by: Jon TURNEY <[email protected]>
Reviewed-by: Colin Harrison <[email protected]>
  • Loading branch information
jon-turney committed Jan 16, 2013
1 parent 56e9440 commit d6dcde7
Showing 1 changed file with 27 additions and 32 deletions.
59 changes: 27 additions & 32 deletions hw/xwin/winmultiwindowwndproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,41 +870,36 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

/* */
if (!pWin->overrideRedirect) {
HWND zstyle = HWND_NOTOPMOST;

/* Flag that this window needs to be made active when clicked */
SetProp(hwnd, WIN_NEEDMANAGE_PROP, (HANDLE) 1);

if (!(GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_APPWINDOW)) {
HWND zstyle = HWND_NOTOPMOST;

/* Set the window extended style flags */
SetWindowLongPtr(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW);

/* 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);

{
WinXWMHints hints;

if (winMultiWindowGetWMHints(pWin, &hints)) {
/*
Give the window focus, unless it has an InputHint
which is FALSE (this is used by e.g. glean to
avoid every test window grabbing the focus)
*/
if (!((hints.flags & InputHint) && (!hints.input))) {
SetForegroundWindow(hwnd);
}
/* 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);

{
WinXWMHints hints;

if (winMultiWindowGetWMHints(pWin, &hints)) {
/*
Give the window focus, unless it has an InputHint
which is FALSE (this is used by e.g. glean to
avoid every test window grabbing the focus)
*/
if (!((hints.flags & InputHint) && (!hints.input))) {
SetForegroundWindow(hwnd);
}
}
}
Expand Down

0 comments on commit d6dcde7

Please sign in to comment.