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
91eced0c
Commit
91eced0c
authored
Dec 22, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Only store dialog focus when window is hidden or inactive.
parent
02f9edfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
defdlg.c
dlls/user32/defdlg.c
+1
-3
dialog.c
dlls/user32/tests/dialog.c
+18
-0
No files found.
dlls/user32/defdlg.c
View file @
91eced0c
...
...
@@ -105,9 +105,7 @@ static void DEFDLG_RestoreFocus( HWND hwnd, BOOL justActivate )
SetFocus
(
infoPtr
->
hwndFocus
);
else
DEFDLG_SetFocus
(
infoPtr
->
hwndFocus
);
/* This used to set infoPtr->hwndFocus to NULL for no apparent reason,
sometimes losing focus when receiving WM_SETFOCUS messages. */
infoPtr
->
hwndFocus
=
NULL
;
}
...
...
dlls/user32/tests/dialog.c
View file @
91eced0c
...
...
@@ -1357,6 +1357,24 @@ static void test_SaveRestoreFocus(void)
foundId
=
GetWindowLongPtrA
(
GetFocus
(),
GWLP_ID
);
ok
(
foundId
==
1001
,
"Second edit box should have gained focus after dialog reactivation. Expected: %d, Found: %ld
\n
"
,
1001
,
foundId
);
/* set focus to the dialog */
SetFocus
(
hDlg
);
foundId
=
GetWindowLongPtrA
(
GetFocus
(),
GWLP_ID
);
ok
(
foundId
==
1000
,
"First edit box should have gained focus on dialog focus. Expected: %d, Found: %ld
\n
"
,
1000
,
foundId
);
/* select second tabbable item */
SetFocus
(
GetNextDlgTabItem
(
hDlg
,
GetNextDlgTabItem
(
hDlg
,
NULL
,
FALSE
),
FALSE
));
foundId
=
GetWindowLongPtrA
(
GetFocus
(),
GWLP_ID
);
ok
(
foundId
==
1001
,
"Second edit box should have gained focus. Expected: %d, Found: %ld
\n
"
,
1001
,
foundId
);
/* send WM_ACTIVATE message to already active dialog */
SendMessageA
(
hDlg
,
WM_ACTIVATE
,
MAKEWPARAM
(
WA_ACTIVE
,
0
),
0
);
foundId
=
GetWindowLongPtrA
(
GetFocus
(),
GWLP_ID
);
ok
(
foundId
==
1001
,
"Second edit box should have gained focus. Expected: %d, Found: %ld
\n
"
,
1001
,
foundId
);
/* disable the 2nd box */
EnableWindow
(
GetFocus
(),
FALSE
);
...
...
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