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
b8edf184
Commit
b8edf184
authored
Sep 18, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add a helper function to set input focus for non-managed windows.
parent
41d03165
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
31 deletions
+43
-31
event.c
dlls/winex11.drv/event.c
+43
-1
window.c
dlls/winex11.drv/window.c
+0
-30
No files found.
dlls/winex11.drv/event.c
View file @
b8edf184
...
...
@@ -530,6 +530,31 @@ static inline BOOL can_activate_window( HWND hwnd )
/**********************************************************************
* set_input_focus
*
* Try to force focus for non-managed windows.
*/
static
void
set_input_focus
(
Display
*
display
,
Window
window
)
{
XWindowChanges
changes
;
DWORD
timestamp
;
if
(
!
window
)
return
;
if
(
EVENT_x11_time_to_win32_time
(
0
))
/* ICCCM says don't use CurrentTime, so try to use last message time if possible */
/* FIXME: this is not entirely correct */
timestamp
=
GetMessageTime
()
-
EVENT_x11_time_to_win32_time
(
0
);
else
timestamp
=
CurrentTime
;
/* Set X focus and install colormap */
changes
.
stack_mode
=
Above
;
XConfigureWindow
(
display
,
window
,
CWStackMode
,
&
changes
);
XSetInputFocus
(
display
,
window
,
RevertToParent
,
timestamp
);
}
/**********************************************************************
* set_focus
*/
static
void
set_focus
(
Display
*
display
,
HWND
hwnd
,
Time
time
)
...
...
@@ -855,7 +880,8 @@ static void X11DRV_MapNotify( HWND hwnd, XEvent *event )
if
(
!
data
->
managed
)
{
HWND
hwndFocus
=
GetFocus
();
if
(
hwndFocus
&&
IsChild
(
hwnd
,
hwndFocus
))
X11DRV_SetFocus
(
hwndFocus
);
/* FIXME */
if
(
hwndFocus
&&
IsChild
(
hwnd
,
hwndFocus
))
set_input_focus
(
thread_display
(),
data
->
whole_window
);
}
}
...
...
@@ -1240,6 +1266,22 @@ void wait_for_withdrawn_state( HWND hwnd, BOOL set )
}
/*****************************************************************
* SetFocus (X11DRV.@)
*
* Set the X focus.
*/
void
CDECL
X11DRV_SetFocus
(
HWND
hwnd
)
{
Display
*
display
=
thread_display
();
struct
x11drv_win_data
*
data
;
if
(
!
(
hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
)))
return
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
if
(
!
data
->
managed
)
set_input_focus
(
display
,
data
->
whole_window
);
}
static
HWND
find_drop_window
(
HWND
hQueryWnd
,
LPPOINT
lpPt
)
{
RECT
tempRect
;
...
...
dlls/winex11.drv/window.c
View file @
b8edf184
...
...
@@ -1989,36 +1989,6 @@ void CDECL X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent )
}
/*****************************************************************
* SetFocus (X11DRV.@)
*
* Set the X focus.
*/
void
CDECL
X11DRV_SetFocus
(
HWND
hwnd
)
{
Display
*
display
=
thread_display
();
struct
x11drv_win_data
*
data
;
XWindowChanges
changes
;
DWORD
timestamp
;
if
(
!
(
hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
)))
return
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
if
(
data
->
managed
||
!
data
->
whole_window
)
return
;
if
(
EVENT_x11_time_to_win32_time
(
0
))
/* ICCCM says don't use CurrentTime, so try to use last message time if possible */
/* FIXME: this is not entirely correct */
timestamp
=
GetMessageTime
()
-
EVENT_x11_time_to_win32_time
(
0
);
else
timestamp
=
CurrentTime
;
/* Set X focus and install colormap */
changes
.
stack_mode
=
Above
;
XConfigureWindow
(
display
,
data
->
whole_window
,
CWStackMode
,
&
changes
);
XSetInputFocus
(
display
,
data
->
whole_window
,
RevertToParent
,
timestamp
);
}
static
inline
RECT
get_surface_rect
(
const
RECT
*
visible_rect
)
{
RECT
rect
;
...
...
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