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
5c8ceb49
Commit
5c8ceb49
authored
Sep 10, 2004
by
Zach Gorman
Committed by
Alexandre Julliard
Sep 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modal dialogs should not be shown via ShowWindow until the message
queue first runs empty. This allows all initialization to complete before a default focus is assigned.
parent
85b06836
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
dialog.c
dlls/user/tests/dialog.c
+5
-5
dialog.c
windows/dialog.c
+11
-5
No files found.
dlls/user/tests/dialog.c
View file @
5c8ceb49
...
...
@@ -761,13 +761,13 @@ static void InitialFocusTest (void)
ok
(((
g_styleInitialFocusT1
&
WS_TABSTOP
)
==
0
),
"Error in wrc - Detected WS_TABSTOP as default style for GROUPBOX
\n
"
);
todo_wine
ok
(((
g_styleInitialFocusT2
&
WS_VISIBLE
)
==
0
),
ok
(((
g_styleInitialFocusT2
&
WS_VISIBLE
)
==
0
),
"Modal dialogs should not be shown until the message queue first goes empty
\n
"
);
todo_wine
ok
((
g_hwndInitialFocusT1
==
NULL
),
"Error in initial focus when WM_INITDIALOG returned FALSE: "
"Expected NULL focus, got %s (%p).
\n
"
,
GetHwndString
(
g_hwndInitialFocusT1
),
g_hwndInitialFocusT1
);
ok
((
g_hwndInitialFocusT1
==
NULL
),
"Error in initial focus when WM_INITDIALOG returned FALSE: "
"Expected NULL focus, got %s (%p).
\n
"
,
GetHwndString
(
g_hwndInitialFocusT1
),
g_hwndInitialFocusT1
);
todo_wine
ok
((
g_hwndInitialFocusT2
==
g_hwndButton2
),
"Error after first SetFocus() when WM_INITDIALOG returned FALSE: "
...
...
windows/dialog.c
View file @
5c8ceb49
...
...
@@ -765,24 +765,30 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
MSG
msg
;
INT
retval
;
HWND
ownerMsg
=
GetAncestor
(
owner
,
GA_ROOT
);
BOOL
bFirstEmpty
;
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
,
FALSE
)))
return
-
1
;
bFirstEmpty
=
TRUE
;
if
(
!
(
dlgInfo
->
flags
&
DF_END
))
/* was EndDialog called in WM_INITDIALOG ? */
{
ShowWindow
(
hwnd
,
SW_SHOW
);
for
(;;)
{
if
(
!
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
DS_NOIDLEMSG
))
if
(
!
PeekMessageW
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
!
PeekMessageW
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
)
)
if
(
bFirstEmpty
)
{
/* ShowWindow the first time the queue goes empty */
ShowWindow
(
hwnd
,
SW_SHOWNORMAL
);
bFirstEmpty
=
FALSE
;
}
if
(
!
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
DS_NOIDLEMSG
))
{
/* No message present -> send ENTERIDLE and wait */
SendMessageW
(
ownerMsg
,
WM_ENTERIDLE
,
MSGF_DIALOGBOX
,
(
LPARAM
)
hwnd
);
if
(
!
GetMessageW
(
&
msg
,
0
,
0
,
0
))
break
;
}
if
(
!
GetMessageW
(
&
msg
,
0
,
0
,
0
))
break
;
}
else
if
(
!
GetMessageW
(
&
msg
,
0
,
0
,
0
))
break
;
if
(
!
IsWindow
(
hwnd
))
return
-
1
;
if
(
!
(
dlgInfo
->
flags
&
DF_END
)
&&
!
IsDialogMessageW
(
hwnd
,
&
msg
))
...
...
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