kwo pushed a commit to branch master.

commit ba29ecf04ea3d6a8b4eb20f128b9daa4761e8988
Author: Kim Woelders <[email protected]>
Date:   Tue Apr 2 21:49:55 2013 +0200

    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 <[email protected]>.
---
 AUTHORS     | 3 +++
 src/ewins.c | 3 ++-
 src/icccm.c | 7 ++++---
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index d2377e4..cff2470 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -280,5 +280,8 @@ Aron Xu <[email protected]>
 Daniel Manjarres <[email protected]>
        Improved strut handling options, other patches and suggestions.
 
+Tim Howe <[email protected]>
+       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)
diff --git a/src/ewins.c b/src/ewins.c
index f781dce..c66d5d0 100644
--- a/src/ewins.c
+++ b/src/ewins.c
@@ -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;
diff --git a/src/icccm.c b/src/icccm.c
index 1279c29..19b621d 100644
--- a/src/icccm.c
+++ b/src/icccm.c
@@ -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

-- 

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

Reply via email to