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
2e0ca3e7
Commit
2e0ca3e7
authored
Nov 13, 2013
by
Sebastian Lackner
Committed by
Alexandre Julliard
Nov 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Send XEMBED_REQUEST_FOCUS request for embedded windows.
parent
815f252b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
9 deletions
+48
-9
event.c
dlls/winex11.drv/event.c
+48
-9
No files found.
dlls/winex11.drv/event.c
View file @
2e0ca3e7
...
@@ -183,6 +183,31 @@ static inline void free_event_data( XEvent *event )
...
@@ -183,6 +183,31 @@ static inline void free_event_data( XEvent *event )
}
}
/***********************************************************************
/***********************************************************************
* xembed_request_focus
*/
static
void
xembed_request_focus
(
Display
*
display
,
Window
window
,
DWORD
timestamp
)
{
XEvent
xev
;
xev
.
xclient
.
type
=
ClientMessage
;
xev
.
xclient
.
window
=
window
;
xev
.
xclient
.
message_type
=
x11drv_atom
(
_XEMBED
);
xev
.
xclient
.
serial
=
0
;
xev
.
xclient
.
display
=
display
;
xev
.
xclient
.
send_event
=
True
;
xev
.
xclient
.
format
=
32
;
xev
.
xclient
.
data
.
l
[
0
]
=
timestamp
;
xev
.
xclient
.
data
.
l
[
1
]
=
XEMBED_REQUEST_FOCUS
;
xev
.
xclient
.
data
.
l
[
2
]
=
0
;
xev
.
xclient
.
data
.
l
[
3
]
=
0
;
xev
.
xclient
.
data
.
l
[
4
]
=
0
;
XSendEvent
(
display
,
window
,
False
,
NoEventMask
,
&
xev
);
XFlush
(
display
);
}
/***********************************************************************
* X11DRV_register_event_handler
* X11DRV_register_event_handler
*
*
* Register a handler for a given event type.
* Register a handler for a given event type.
...
@@ -532,14 +557,14 @@ static inline BOOL can_activate_window( HWND hwnd )
...
@@ -532,14 +557,14 @@ static inline BOOL can_activate_window( HWND hwnd )
/**********************************************************************
/**********************************************************************
* set_input_focus
* set_input_focus
*
*
* Try to force focus for non-managed windows.
* Try to force focus for
embedded or
non-managed windows.
*/
*/
static
void
set_input_focus
(
Display
*
display
,
Window
window
)
static
void
set_input_focus
(
struct
x11drv_win_data
*
data
)
{
{
XWindowChanges
changes
;
XWindowChanges
changes
;
DWORD
timestamp
;
DWORD
timestamp
;
if
(
!
window
)
return
;
if
(
!
data
->
whole_
window
)
return
;
if
(
EVENT_x11_time_to_win32_time
(
0
))
if
(
EVENT_x11_time_to_win32_time
(
0
))
/* ICCCM says don't use CurrentTime, so try to use last message time if possible */
/* ICCCM says don't use CurrentTime, so try to use last message time if possible */
...
@@ -550,8 +575,13 @@ static void set_input_focus( Display *display, Window window )
...
@@ -550,8 +575,13 @@ static void set_input_focus( Display *display, Window window )
/* Set X focus and install colormap */
/* Set X focus and install colormap */
changes
.
stack_mode
=
Above
;
changes
.
stack_mode
=
Above
;
XConfigureWindow
(
display
,
window
,
CWStackMode
,
&
changes
);
XConfigureWindow
(
data
->
display
,
data
->
whole_window
,
CWStackMode
,
&
changes
);
XSetInputFocus
(
display
,
window
,
RevertToParent
,
timestamp
);
if
(
data
->
embedder
)
xembed_request_focus
(
data
->
display
,
data
->
embedder
,
timestamp
);
else
XSetInputFocus
(
data
->
display
,
data
->
whole_window
,
RevertToParent
,
timestamp
);
}
}
/**********************************************************************
/**********************************************************************
...
@@ -904,7 +934,7 @@ static void X11DRV_MapNotify( HWND hwnd, XEvent *event )
...
@@ -904,7 +934,7 @@ static void X11DRV_MapNotify( HWND hwnd, XEvent *event )
{
{
HWND
hwndFocus
=
GetFocus
();
HWND
hwndFocus
=
GetFocus
();
if
(
hwndFocus
&&
IsChild
(
hwnd
,
hwndFocus
))
if
(
hwndFocus
&&
IsChild
(
hwnd
,
hwndFocus
))
set_input_focus
(
data
->
display
,
data
->
whole_window
);
set_input_focus
(
data
);
}
}
release_win_data
(
data
);
release_win_data
(
data
);
}
}
...
@@ -1365,9 +1395,18 @@ void CDECL X11DRV_SetFocus( HWND hwnd )
...
@@ -1365,9 +1395,18 @@ void CDECL X11DRV_SetFocus( HWND hwnd )
{
{
struct
x11drv_win_data
*
data
;
struct
x11drv_win_data
*
data
;
if
(
!
(
hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
)))
return
;
HWND
parent
;
if
(
!
(
data
=
get_win_data
(
hwnd
)))
return
;
if
(
!
data
->
managed
)
set_input_focus
(
data
->
display
,
data
->
whole_window
);
for
(;;)
{
if
(
!
(
data
=
get_win_data
(
hwnd
)))
return
;
if
(
data
->
embedded
)
break
;
parent
=
GetAncestor
(
hwnd
,
GA_PARENT
);
if
(
!
parent
||
parent
==
GetDesktopWindow
())
break
;
release_win_data
(
data
);
hwnd
=
parent
;
}
if
(
!
data
->
managed
||
data
->
embedder
)
set_input_focus
(
data
);
release_win_data
(
data
);
release_win_data
(
data
);
}
}
...
...
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