Fix Globally Active focus mode.

Something changed somewhere in java 7 which seems to require that the
"Globally Active" focus mode is handled properly, otherwise input focus
is entirely broken.

Parts of patch by Tim Howe <vsync@quadium.net>.
This commit is contained in:
Kim Woelders 2013-04-02 21:49:55 +02:00
parent 89c1602253
commit ba29ecf04e
3 changed files with 9 additions and 4 deletions

View File

@ -280,5 +280,8 @@ Aron Xu <aronmalache@163.com>
Daniel Manjarres <manjarrs@illinois.edu>
Improved strut handling options, other patches and suggestions.
Tim Howe <vsync@quadium.net>
Fix focus handling to support "Globally Active" model (used by Java)
And others whose names we probably forgot to add (email us and we'll put you
in here)

View File

@ -703,7 +703,8 @@ EwinStateUpdate(EWin * ewin)
fs_zo = ewin->state.fullscreen || ewin->state.zoomed;
ewin->state.inhibit_actions = ewin->props.no_actions;
ewin->state.inhibit_focus = !ewin->icccm.need_input ||
ewin->state.inhibit_focus =
!(ewin->icccm.need_input || ewin->icccm.take_focus) ||
EwinInhGetWM(ewin, focus) || ewin->state.iconified;
ewin->state.inhibit_move = EwinInhGetUser(ewin, move) || fs_zo;

View File

@ -402,8 +402,9 @@ ICCCM_Focus(const EWin * ewin)
Mode.events.time);
}
XSetInputFocus(disp, EwinGetClientXwin(ewin), RevertToPointerRoot,
Mode.events.time);
if (ewin->icccm.need_input)
XSetInputFocus(disp, EwinGetClientXwin(ewin),
RevertToPointerRoot, Mode.events.time);
HintsSetActiveWindow(EwinGetClientXwin(ewin));
}
@ -717,7 +718,7 @@ ICCCM_GetWmProtocols(EWin * ewin)
for (i = 0; i < num; i++)
{
if (prop[i] == ECORE_X_ATOM_WM_TAKE_FOCUS)
ewin->icccm.take_focus = ewin->icccm.need_input = 1;
ewin->icccm.take_focus = 1;
else if (prop[i] == ECORE_X_ATOM_WM_DELETE_WINDOW)
ewin->icccm.delete_window = 1;
#if USE_XSYNC