[Xfce4-commits] [xfce/xfwm4] 01/01: stacking: Raise on focus to activate

noreply at xfce.org noreply at xfce.org
Tue Jun 14 09:12:53 CEST 2016


This is an automated email from the git hooks/post-receive script.

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit 3877bf45d39928b2ec485945af1fba7a16645c7d
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Mon Jun 13 11:41:24 2016 +0200

    stacking: Raise on focus to activate
    
    Bug: 12634
    
    xfwm4 would raise a client upon receiving the _NET_ACTIVE_WINDOW message
    but if the client provided an old timestamp, the window won't be focused
    (as the timestamp will be older than the last current X server time).
    
    To avoid this, only raise the window on focus event notification and
    when using click-to-focus mode.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/client.c | 10 +++++++---
 src/focus.c  |  9 ++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/client.c b/src/client.c
index d072683..668c11b 100644
--- a/src/client.c
+++ b/src/client.c
@@ -2612,21 +2612,25 @@ clientActivate (Client *c, guint32 timestamp, gboolean source_is_application)
                 workspaceSwitch (screen_info, c->win_workspace, NULL, FALSE, timestamp);
             }
         }
-        clientRaise (sibling, None);
         clientShow (sibling, TRUE);
+        if (!screen_info->params->click_to_focus)
+        {
+            clientRaise (sibling, None);
+            clientSetLastRaise (c);
+        }
         if (!source_is_application || screen_info->params->click_to_focus || (c->type & WINDOW_TYPE_DONT_FOCUS))
         {
             /*
                It's a bit tricky here, we want to honor the activate request only if:
 
                - The window use the _NET_ACTIVE_WINDOW protocol and identify itself as a pager,
-               - Or we use the click to focus model, in that case we focus the raised window anyway,
+               - Or we use the click to focus model, in that case we focus the window anyway,
                - Or the request comes from an application that we would not focus by default,
                  such as panels for example
              */
+
             clientSetFocus (screen_info, c, timestamp, NO_FOCUS_FLAG);
         }
-        clientSetLastRaise (c);
     }
     else
     {
diff --git a/src/focus.c b/src/focus.c
index 183f4e8..7255544 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -482,6 +482,7 @@ void
 clientUpdateFocus (ScreenInfo *screen_info, Client * c, unsigned short flags)
 {
     Client *c2;
+    gboolean restacked;
 
     TRACE ("entering clientUpdateFocus");
 
@@ -522,7 +523,13 @@ clientUpdateFocus (ScreenInfo *screen_info, Client * c, unsigned short flags)
             FLAG_UNSET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
         }
         clientSetNetState (c);
-        clientAdjustFullscreenLayer (c, TRUE);
+        restacked = clientAdjustFullscreenLayer (c, TRUE);
+
+        if (!restacked && screen_info->params->click_to_focus)
+        {
+            clientRaise (c, None);
+            clientSetLastRaise (c);
+        }
         frameQueueDraw (c, FALSE);
         clientUpdateOpacity (c);
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list