[Xfce4-commits] [xfce/xfwm4] 02/02: Check class hint name for same applications

noreply at xfce.org noreply at xfce.org
Sat Mar 14 22:19:59 CET 2015


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

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

commit 77dc4e95951666591a9e9a636450a6f5fd1709b1
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Sat Mar 14 22:12:29 2015 +0100

    Check class hint name for same applications
    
    Bug: 11685
    
    There was some confusion in the definition of "same application" when
    cycling through windows of the same application.
    
    Same application meant windows which share a common leader or from the
    same group, which basically means the same running application, not
    two different instances of the same program.
    
    Widen the search criteria to the WM class "resource name" which
    contains the application name so that multiple different  instances of
    the same program/application can be included.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/transients.c |   15 +++++++++++++++
 src/transients.h |    4 +++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/transients.c b/src/transients.c
index 3cd2105..a337ab0 100644
--- a/src/transients.c
+++ b/src/transients.c
@@ -113,6 +113,20 @@ clientSameLeader (Client * c1, Client * c2)
 }
 
 gboolean
+clientSameName (Client * c1, Client * c2)
+{
+    g_return_val_if_fail (c1 != NULL, FALSE);
+    g_return_val_if_fail (c2 != NULL, FALSE);
+
+    TRACE ("entering clientSameName");
+
+    return ((c1 != c2) &&
+            (c1->class.res_class != NULL) &&
+            (c2->class.res_class != NULL) &&
+            (strcmp (c1->class.res_name, c2->class.res_name) == 0));
+}
+
+gboolean
 clientIsTransientFor (Client * c1, Client * c2)
 {
     g_return_val_if_fail (c1 != NULL, FALSE);
@@ -445,6 +459,7 @@ clientSameApplication (Client *c1, Client *c2)
             clientIsTransientOrModalFor (c2, c1) ||
             clientSameGroup (c1, c2) ||
             clientSameLeader (c1, c2) ||
+            clientSameName (c1, c2) ||
             (c1->pid != 0 && c1->pid == c2->pid &&
              c1->hostname && c2->hostname &&
              !g_ascii_strcasecmp (c1->hostname, c2->hostname)));
diff --git a/src/transients.h b/src/transients.h
index 702fe79..029e25d 100644
--- a/src/transients.h
+++ b/src/transients.h
@@ -37,7 +37,9 @@ gboolean                 clientIsTransientOrModal               (Client *);
 gboolean                 clientIsValidTransientOrModal          (Client *);
 gboolean                 clientSameGroup                        (Client *,
                                                                  Client *);
-gboolean                 clientSameLeader                        (Client *,
+gboolean                 clientSameLeader                       (Client *,
+                                                                 Client *);
+gboolean                 clientSameName                         (Client *,
                                                                  Client *);
 gboolean                 clientSameApplication                  (Client *,
                                                                  Client *);

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


More information about the Xfce4-commits mailing list