Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9b2dd2db
Commit
9b2dd2db
authored
Jan 30, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Kill focus before minimizing a window.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
636d6a60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
win.c
dlls/user32/tests/win.c
+30
-1
winpos.c
dlls/user32/winpos.c
+8
-0
No files found.
dlls/user32/tests/win.c
View file @
9b2dd2db
...
...
@@ -3113,7 +3113,6 @@ todo_wine
ShowWindow
(
hwnd
,
SW_SHOWMINIMIZED
);
ok
(
GetActiveWindow
()
==
hwnd
,
"parent window %p should be active
\n
"
,
hwnd
);
ok
(
GetFocus
()
!=
child
,
"Focus should not be on child %p
\n
"
,
child
);
todo_wine
ok
(
GetFocus
()
!=
hwnd
,
"Focus should not be on parent %p
\n
"
,
hwnd
);
old_wnd_proc
=
(
WNDPROC
)
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
set_focus_on_activate_proc
);
ShowWindow
(
hwnd
,
SW_RESTORE
);
...
...
@@ -10072,6 +10071,13 @@ static void test_minimize_window(HWND hwndMain)
ShowWindow
(
hwnd2
,
SW_RESTORE
);
check_active_state
(
hwnd2
,
hwnd2
,
hwnd2
);
/* try SW_SHOWMINIMIZED */
ShowWindow
(
hwnd2
,
SW_SHOWMINIMIZED
);
check_active_state
(
hwnd2
,
hwnd2
,
0
);
ShowWindow
(
hwnd2
,
SW_RESTORE
);
check_active_state
(
hwnd2
,
hwnd2
,
hwnd2
);
/* hide a non-active window */
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
check_active_state
(
hwnd2
,
hwnd2
,
hwnd2
);
...
...
@@ -10115,6 +10121,11 @@ static void test_minimize_window(HWND hwndMain)
todo_wine
check_active_state
(
hwnd2
,
hwnd2
,
hwnd2
);
/* with SW_SHOWMINIMIZED */
ShowWindow
(
hwnd3
,
SW_RESTORE
);
ShowWindow
(
hwnd3
,
SW_SHOWMINIMIZED
);
check_active_state
(
hwnd3
,
hwnd3
,
0
);
/* hide an owner window */
ShowWindow
(
hwnd
,
SW_RESTORE
);
ShowWindow
(
hwnd2
,
SW_RESTORE
);
...
...
@@ -10124,6 +10135,24 @@ static void test_minimize_window(HWND hwndMain)
check_active_state
(
hwnd2
,
hwnd2
,
hwnd2
);
DestroyWindow
(
hwnd3
);
/* test a child window - focus should be yielded back to the parent */
ShowWindow
(
hwnd
,
SW_RESTORE
);
hwnd3
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
"Child window 3"
,
WS_CHILD
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
hwnd
,
0
,
GetModuleHandleA
(
NULL
),
NULL
);
SetFocus
(
hwnd3
);
check_active_state
(
hwnd
,
hwnd
,
hwnd3
);
ShowWindow
(
hwnd3
,
SW_MINIMIZE
);
check_active_state
(
hwnd
,
hwnd
,
hwnd
);
/* with SW_SHOWMINIMIZED */
ShowWindow
(
hwnd3
,
SW_RESTORE
);
SetFocus
(
hwnd3
);
check_active_state
(
hwnd
,
hwnd
,
hwnd3
);
ShowWindow
(
hwnd3
,
SW_SHOWMINIMIZED
);
check_active_state
(
hwnd
,
hwnd
,
hwnd
);
DestroyWindow
(
hwnd3
);
DestroyWindow
(
hwnd2
);
DestroyWindow
(
hwnd
);
}
...
...
dlls/user32/winpos.c
View file @
9b2dd2db
...
...
@@ -983,6 +983,14 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
if
(
IsZoomed
(
hwnd
))
win_set_flags
(
hwnd
,
WIN_RESTORE_MAX
,
0
);
else
win_set_flags
(
hwnd
,
0
,
WIN_RESTORE_MAX
);
if
(
GetFocus
()
==
hwnd
)
{
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
SetFocus
(
GetAncestor
(
hwnd
,
GA_PARENT
));
else
SetFocus
(
0
);
}
old_style
=
WIN_SetStyle
(
hwnd
,
WS_MINIMIZE
,
WS_MAXIMIZE
);
wpl
.
ptMinPosition
=
WINPOS_FindIconPos
(
hwnd
,
wpl
.
ptMinPosition
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment