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
142133ae
Commit
142133ae
authored
Feb 25, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Always enable owner window in EndDialog.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
26b37c40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
dialog.c
dlls/user32/dialog.c
+2
-6
msg.c
dlls/user32/tests/msg.c
+24
-4
No files found.
dlls/user32/dialog.c
View file @
142133ae
...
...
@@ -921,7 +921,6 @@ INT_PTR WINAPI DialogBoxIndirectParamW(HINSTANCE hInstance, LPCDLGTEMPLATEW temp
*/
BOOL
WINAPI
EndDialog
(
HWND
hwnd
,
INT_PTR
retval
)
{
BOOL
wasEnabled
;
DIALOGINFO
*
dlgInfo
;
HWND
owner
;
...
...
@@ -934,10 +933,9 @@ BOOL WINAPI EndDialog( HWND hwnd, INT_PTR retval )
}
dlgInfo
->
idResult
=
retval
;
dlgInfo
->
flags
|=
DF_END
;
wasEnabled
=
(
dlgInfo
->
flags
&
DF_OWNERENABLED
);
owner
=
GetWindow
(
hwnd
,
GW_OWNER
);
if
(
wasEnabled
&&
owner
)
if
(
owner
)
DIALOG_EnableOwner
(
owner
);
/* Windows sets the focus to the dialog itself in EndDialog */
...
...
@@ -953,9 +951,7 @@ BOOL WINAPI EndDialog( HWND hwnd, INT_PTR retval )
if
(
hwnd
==
GetActiveWindow
())
{
/* If this dialog was given an owner then set the focus to that owner
even when the owner is disabled (normally when a window closes any
disabled windows cannot receive the focus). */
/* If this dialog was given an owner then set the focus to that owner. */
if
(
owner
)
SetForegroundWindow
(
owner
);
else
...
...
dlls/user32/tests/msg.c
View file @
142133ae
...
...
@@ -12226,7 +12226,7 @@ static void test_EndDialog(void)
hother
=
CreateWindowExA
(
0
,
"TestParentClass"
,
"Test parent 2"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
1
00
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
2
00
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hother
!=
0
,
"Failed to create parent window
\n
"
);
ok
(
GetClassInfoA
(
0
,
"#32770"
,
&
cls
),
"GetClassInfo failed
\n
"
);
...
...
@@ -12240,20 +12240,40 @@ static void test_EndDialog(void)
hactive
=
GetForegroundWindow
();
ok
(
hother
==
hactive
,
"Wrong window has focus (%p != %p)
\n
"
,
hother
,
hactive
);
/* create a dialog where the parent is disabled, this parent should still
receive the focus when the dialog exits (even though "normally" a
disabled window should not receive the focus) */
/* create a dialog where the parent is disabled, this parent should be
* enabled and receive focus when dialog exits */
hdlg
=
CreateDialogParamA
(
0
,
"CLASS_TEST_DIALOG_2"
,
hparent
,
test_dlg_proc
,
0
);
ok
(
IsWindow
(
hdlg
),
"CreateDialogParam failed
\n
"
);
SetForegroundWindow
(
hdlg
);
hactive
=
GetForegroundWindow
();
ok
(
hdlg
==
hactive
,
"Wrong window has focus (%p != %p)
\n
"
,
hdlg
,
hactive
);
EndDialog
(
hdlg
,
0
);
ok
(
IsWindowEnabled
(
hparent
),
"parent is not enabled
\n
"
);
hactive
=
GetForegroundWindow
();
ok
(
hparent
==
hactive
,
"Wrong window has focus (parent != active) (active: %p, parent: %p, dlg: %p, other: %p)
\n
"
,
hactive
,
hparent
,
hdlg
,
hother
);
DestroyWindow
(
hdlg
);
flush_sequence
();
/* create a dialog where the parent is disabled and set active window to other window before calling EndDialog */
EnableWindow
(
hparent
,
FALSE
);
hdlg
=
CreateWindowExA
(
0
,
"TestDialogClass"
,
NULL
,
WS_VISIBLE
|
WS_CAPTION
|
WS_SYSMENU
|
WS_DLGFRAME
,
0
,
0
,
100
,
100
,
hparent
,
0
,
0
,
NULL
);
ok
(
IsWindow
(
hdlg
),
"CreateDialogParam failed
\n
"
);
flush_sequence
();
SetForegroundWindow
(
hother
);
flush_sequence
();
hactive
=
GetForegroundWindow
();
ok
(
hactive
==
hother
,
"Wrong foreground (%p != %p)
\n
"
,
hactive
,
hother
);
hactive
=
GetActiveWindow
();
ok
(
hactive
==
hother
,
"Wrong active window (%p != %p)
\n
"
,
hactive
,
hother
);
EndDialog
(
hdlg
,
0
);
ok
(
IsWindowEnabled
(
hparent
),
"parent is not enabled
\n
"
);
hactive
=
GetForegroundWindow
();
ok
(
hother
==
hactive
,
"Wrong window has focus (other != active) (active: %p, parent: %p, dlg: %p, other: %p)
\n
"
,
hactive
,
hparent
,
hdlg
,
hother
);
DestroyWindow
(
hdlg
);
flush_sequence
();
DestroyWindow
(
hother
);
DestroyWindow
(
hparent
);
UnregisterClassA
(
cls
.
lpszClassName
,
cls
.
hInstance
);
...
...
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