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
36d7ca38
Commit
36d7ca38
authored
Jul 24, 1999
by
Noel Borthwick
Committed by
Alexandre Julliard
Jul 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
While handling the X FocusIn message in managed mode, if the window
has been disabled revert the X focus back to the last focus window.
parent
56c36e3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletion
+39
-1
event.c
windows/x11drv/event.c
+39
-1
No files found.
windows/x11drv/event.c
View file @
36d7ca38
...
...
@@ -64,6 +64,8 @@ extern void X11DRV_KEYBOARD_HandleEvent(WND *pWnd, XKeyEvent *event);
#define DndURL 128
/* KDE drag&drop */
/* The last X window which had the focus */
static
Window
glastXFocusWin
=
0
;
static
const
char
*
const
event_names
[]
=
{
...
...
@@ -258,14 +260,50 @@ static void EVENT_ProcessEvent( XEvent *event )
break
;
case
FocusIn
:
{
WND
*
pWndLastFocus
=
0
;
XWindowAttributes
win_attr
;
BOOL
bIsDisabled
;
XFocusChangeEvent
*
xfocChange
=
(
XFocusChangeEvent
*
)
event
;
if
(
!
hWnd
||
bUserRepaintDisabled
)
return
;
EVENT_FocusIn
(
hWnd
,
(
XFocusChangeEvent
*
)
event
);
bIsDisabled
=
GetWindowLongA
(
hWnd
,
GWL_STYLE
)
&
WS_DISABLED
;
/* If the window has been disabled and we are in managed mode,
* revert the X focus back to the last focus window. This is to disallow
* the window manager from switching focus away while the app is
* in a modal state.
*/
if
(
Options
.
managed
&&
bIsDisabled
&&
glastXFocusWin
)
{
/* Change focus only if saved focus window is registered and viewable */
if
(
TSXFindContext
(
xfocChange
->
display
,
glastXFocusWin
,
winContext
,
(
char
**
)
&
pWndLastFocus
)
==
0
)
{
if
(
TSXGetWindowAttributes
(
display
,
glastXFocusWin
,
&
win_attr
)
&&
(
win_attr
.
map_state
==
IsViewable
)
)
{
TSXSetInputFocus
(
xfocChange
->
display
,
glastXFocusWin
,
RevertToParent
,
CurrentTime
);
EVENT_Synchronize
();
break
;
}
}
}
EVENT_FocusIn
(
hWnd
,
xfocChange
);
break
;
}
case
FocusOut
:
{
/* Save the last window which had the focus */
XFocusChangeEvent
*
xfocChange
=
(
XFocusChangeEvent
*
)
event
;
glastXFocusWin
=
xfocChange
->
window
;
if
(
!
hWnd
||
bUserRepaintDisabled
)
return
;
EVENT_FocusOut
(
hWnd
,
(
XFocusChangeEvent
*
)
event
);
break
;
}
case
Expose
:
if
(
bUserRepaintDisabled
)
return
;
...
...
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