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
de219411
Commit
de219411
authored
Mar 27, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Change SetForegroundWindow behavior on windows with parent and no WS_CHILD flag.
parent
7420b7fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
win.c
dlls/user32/tests/win.c
+15
-4
queue.c
server/queue.c
+3
-3
user.h
server/user.h
+1
-1
window.c
server/window.c
+3
-3
No files found.
dlls/user32/tests/win.c
View file @
de219411
...
@@ -2794,6 +2794,7 @@ static void test_SetForegroundWindow(HWND hwnd)
...
@@ -2794,6 +2794,7 @@ static void test_SetForegroundWindow(HWND hwnd)
BOOL
ret
;
BOOL
ret
;
HWND
hwnd2
;
HWND
hwnd2
;
MSG
msg
;
MSG
msg
;
LONG
style
;
flush_events
(
TRUE
);
flush_events
(
TRUE
);
ShowWindow
(
hwnd
,
SW_HIDE
);
ShowWindow
(
hwnd
,
SW_HIDE
);
...
@@ -2889,6 +2890,19 @@ static void test_SetForegroundWindow(HWND hwnd)
...
@@ -2889,6 +2890,19 @@ static void test_SetForegroundWindow(HWND hwnd)
todo_wine
ok
(
GetActiveWindow
()
==
hwnd2
,
"Expected active window %p, got %p.
\n
"
,
hwnd2
,
GetActiveWindow
());
todo_wine
ok
(
GetActiveWindow
()
==
hwnd2
,
"Expected active window %p, got %p.
\n
"
,
hwnd2
,
GetActiveWindow
());
todo_wine
ok
(
GetFocus
()
==
hwnd2
,
"Expected focus window %p, got %p.
\n
"
,
hwnd2
,
GetFocus
());
todo_wine
ok
(
GetFocus
()
==
hwnd2
,
"Expected focus window %p, got %p.
\n
"
,
hwnd2
,
GetFocus
());
SetForegroundWindow
(
hwnd
);
check_wnd_state
(
hwnd
,
hwnd
,
hwnd
,
0
);
style
=
GetWindowLongA
(
hwnd2
,
GWL_STYLE
)
|
WS_CHILD
;
ok
(
SetWindowLongA
(
hwnd2
,
GWL_STYLE
,
style
),
"SetWindowLong failed
\n
"
);
ok
(
SetForegroundWindow
(
hwnd2
),
"SetForegroundWindow failed
\n
"
);
check_wnd_state
(
hwnd2
,
hwnd2
,
hwnd2
,
0
);
SetForegroundWindow
(
hwnd
);
check_wnd_state
(
hwnd
,
hwnd
,
hwnd
,
0
);
ok
(
SetWindowLongA
(
hwnd2
,
GWL_STYLE
,
style
&
(
~
WS_POPUP
)),
"SetWindowLong failed
\n
"
);
ok
(
!
SetForegroundWindow
(
hwnd2
),
"SetForegroundWindow failed
\n
"
);
check_wnd_state
(
hwnd
,
hwnd
,
hwnd
,
0
);
SetEvent
(
thread_params
.
test_finished
);
SetEvent
(
thread_params
.
test_finished
);
WaitForSingleObject
(
thread
,
INFINITE
);
WaitForSingleObject
(
thread
,
INFINITE
);
CloseHandle
(
thread_params
.
test_finished
);
CloseHandle
(
thread_params
.
test_finished
);
...
@@ -3720,7 +3734,6 @@ static void test_SetParent(void)
...
@@ -3720,7 +3734,6 @@ static void test_SetParent(void)
ret
=
SetParent
(
popup
,
child1
);
ret
=
SetParent
(
popup
,
child1
);
ok
(
ret
==
desktop
,
"expected %p, got %p
\n
"
,
desktop
,
ret
);
ok
(
ret
==
desktop
,
"expected %p, got %p
\n
"
,
desktop
,
ret
);
check_parents
(
popup
,
child1
,
child1
,
0
,
0
,
parent
,
popup
);
check_parents
(
popup
,
child1
,
child1
,
0
,
0
,
parent
,
popup
);
todo_wine
check_active_state
(
popup
,
0
,
popup
);
check_active_state
(
popup
,
0
,
popup
);
SetActiveWindow
(
parent
);
SetActiveWindow
(
parent
);
...
@@ -3747,10 +3760,8 @@ todo_wine
...
@@ -3747,10 +3760,8 @@ todo_wine
check_active_state
(
parent
,
0
,
parent
);
check_active_state
(
parent
,
0
,
parent
);
bret
=
SetForegroundWindow
(
popup
);
bret
=
SetForegroundWindow
(
popup
);
todo_wine
ok
(
bret
,
"SetForegroundWindow() failed
\n
"
);
ok
(
bret
,
"SetForegroundWindow() failed
\n
"
);
if
(
bret
)
check_active_state
(
popup
,
popup
,
popup
);
check_active_state
(
popup
,
popup
,
popup
);
ok
(
DestroyWindow
(
parent
),
"DestroyWindow() failed
\n
"
);
ok
(
DestroyWindow
(
parent
),
"DestroyWindow() failed
\n
"
);
...
...
server/queue.c
View file @
de219411
...
@@ -2869,9 +2869,9 @@ DECL_HANDLER(set_foreground_window)
...
@@ -2869,9 +2869,9 @@ DECL_HANDLER(set_foreground_window)
reply
->
send_msg_old
=
(
reply
->
previous
&&
desktop
->
foreground_input
!=
queue
->
input
);
reply
->
send_msg_old
=
(
reply
->
previous
&&
desktop
->
foreground_input
!=
queue
->
input
);
reply
->
send_msg_new
=
FALSE
;
reply
->
send_msg_new
=
FALSE
;
if
(
is_
top_level
_window
(
req
->
handle
)
&&
if
(
is_
valid_foreground
_window
(
req
->
handle
)
&&
(
(
thread
=
get_window_thread
(
req
->
handle
)
))
&&
(
thread
=
get_window_thread
(
req
->
handle
))
&&
(
thread
->
queue
->
input
->
desktop
==
desktop
)
)
thread
->
queue
->
input
->
desktop
==
desktop
)
{
{
set_foreground_input
(
desktop
,
thread
->
queue
->
input
);
set_foreground_input
(
desktop
,
thread
->
queue
->
input
);
reply
->
send_msg_new
=
(
desktop
->
foreground_input
!=
queue
->
input
);
reply
->
send_msg_new
=
(
desktop
->
foreground_input
!=
queue
->
input
);
...
...
server/user.h
View file @
de219411
...
@@ -152,7 +152,7 @@ extern void post_desktop_message( struct desktop *desktop, unsigned int message,
...
@@ -152,7 +152,7 @@ extern void post_desktop_message( struct desktop *desktop, unsigned int message,
extern
void
destroy_window
(
struct
window
*
win
);
extern
void
destroy_window
(
struct
window
*
win
);
extern
void
destroy_thread_windows
(
struct
thread
*
thread
);
extern
void
destroy_thread_windows
(
struct
thread
*
thread
);
extern
int
is_child_window
(
user_handle_t
parent
,
user_handle_t
child
);
extern
int
is_child_window
(
user_handle_t
parent
,
user_handle_t
child
);
extern
int
is_
top_level
_window
(
user_handle_t
window
);
extern
int
is_
valid_foreground
_window
(
user_handle_t
window
);
extern
int
is_window_visible
(
user_handle_t
window
);
extern
int
is_window_visible
(
user_handle_t
window
);
extern
int
is_window_transparent
(
user_handle_t
window
);
extern
int
is_window_transparent
(
user_handle_t
window
);
extern
int
make_window_active
(
user_handle_t
window
);
extern
int
make_window_active
(
user_handle_t
window
);
...
...
server/window.c
View file @
de219411
...
@@ -581,11 +581,11 @@ int is_child_window( user_handle_t parent, user_handle_t child )
...
@@ -581,11 +581,11 @@ int is_child_window( user_handle_t parent, user_handle_t child )
return
0
;
return
0
;
}
}
/* check
whether window is a top-level
window */
/* check
if window can be set as foreground
window */
int
is_
top_level
_window
(
user_handle_t
window
)
int
is_
valid_foreground
_window
(
user_handle_t
window
)
{
{
struct
window
*
win
=
get_user_object
(
window
,
USER_WINDOW
);
struct
window
*
win
=
get_user_object
(
window
,
USER_WINDOW
);
return
(
win
&&
(
is_desktop_window
(
win
)
||
is_desktop_window
(
win
->
parent
)))
;
return
win
&&
(
win
->
style
&
(
WS_POPUP
|
WS_CHILD
))
!=
WS_CHILD
;
}
}
/* make a window active if possible */
/* make a window active if possible */
...
...
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