[Xfce4-commits] [xfce/xfwm4] 06/07: Stack notifications on top of fullscreen windows

noreply at xfce.org noreply at xfce.org
Tue Aug 25 19:02:11 CEST 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 3f29fb1342e6fc76970e8bfbbbc857568349abdc
Author: Lars Luthman <mail at larsluthman.net>
Date:   Tue Aug 25 12:07:05 2015 +0200

    Stack notifications on top of fullscreen windows
    
    Bug: 7928
    
    Add support for _NET_WM_WINDOW_TYPE_NOTIFICATION windows and stack
    them in a specific layer above of all other layers.
---
 src/client.h  |    3 ++-
 src/display.c |    1 +
 src/display.h |    1 +
 src/hints.h   |    1 +
 src/netwm.c   |   15 ++++++++++++++-
 5 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/client.h b/src/client.h
index aa2b1e0..2687033 100644
--- a/src/client.h
+++ b/src/client.h
@@ -254,7 +254,8 @@ typedef enum
     WINDOW_TOOLBAR      = (1 << 5),
     WINDOW_MENU         = (1 << 6),
     WINDOW_UTILITY      = (1 << 7),
-    WINDOW_SPLASHSCREEN = (1 << 8)
+    WINDOW_SPLASHSCREEN = (1 << 8),
+    WINDOW_NOTIFICATION = (1 << 9)
 }
 netWindowType;
 
diff --git a/src/display.c b/src/display.c
index a1cfb02..670e569 100644
--- a/src/display.c
+++ b/src/display.c
@@ -155,6 +155,7 @@ myDisplayInitAtoms (DisplayInfo *display_info)
         "_NET_WM_WINDOW_TYPE_SPLASH",
         "_NET_WM_WINDOW_TYPE_TOOLBAR",
         "_NET_WM_WINDOW_TYPE_UTILITY",
+        "_NET_WM_WINDOW_TYPE_NOTIFICATION",
         "_NET_WORKAREA",
         "MANAGER",
         "PIXMAP",
diff --git a/src/display.h b/src/display.h
index a2f8a9a..44c4ade 100644
--- a/src/display.h
+++ b/src/display.h
@@ -249,6 +249,7 @@ enum
     NET_WM_WINDOW_TYPE_SPLASH,
     NET_WM_WINDOW_TYPE_TOOLBAR,
     NET_WM_WINDOW_TYPE_UTILITY,
+    NET_WM_WINDOW_TYPE_NOTIFICATION,
     NET_WORKAREA,
     MANAGER,
     PIXMAP,
diff --git a/src/hints.h b/src/hints.h
index 48cd814..e099cba 100644
--- a/src/hints.h
+++ b/src/hints.h
@@ -82,6 +82,7 @@
 #define WIN_LAYER_DOCK                          8
 #define WIN_LAYER_ABOVE_DOCK                    10
 #define WIN_LAYER_FULLSCREEN                    12
+#define WIN_LAYER_NOTIFICATION                  14
 
 #define NET_WM_MOVERESIZE_SIZE_TOPLEFT          0
 #define NET_WM_MOVERESIZE_SIZE_TOP              1
diff --git a/src/netwm.c b/src/netwm.c
index 9826c8c..51490e5 100644
--- a/src/netwm.c
+++ b/src/netwm.c
@@ -833,7 +833,8 @@ clientGetNetWmType (Client * c)
                 (atoms[i] == display_info->atoms[NET_WM_WINDOW_TYPE_DIALOG])  ||
                 (atoms[i] == display_info->atoms[NET_WM_WINDOW_TYPE_NORMAL])  ||
                 (atoms[i] == display_info->atoms[NET_WM_WINDOW_TYPE_UTILITY]) ||
-                (atoms[i] == display_info->atoms[NET_WM_WINDOW_TYPE_SPLASH]))
+                (atoms[i] == display_info->atoms[NET_WM_WINDOW_TYPE_SPLASH])  ||
+                (atoms[i] == display_info->atoms[NET_WM_WINDOW_TYPE_NOTIFICATION]))
             {
                 c->type_atom = atoms[i];
                 break;
@@ -1293,6 +1294,18 @@ clientWindowType (Client * c)
                 XFWM_FLAG_HAS_MENU | XFWM_FLAG_HAS_MOVE |
                 XFWM_FLAG_HAS_RESIZE);
         }
+        else if (c->type_atom == display_info->atoms[NET_WM_WINDOW_TYPE_NOTIFICATION])
+        {
+            TRACE ("atom net_wm_window_type_notification detected");
+            c->type = WINDOW_NOTIFICATION;
+            c->initial_layer = WIN_LAYER_NOTIFICATION;
+            /* We unset these because CLIENT_FLAG_ABOVE will interfere with
+               our layer placement and put the window in the ABOVE_DOCK
+               layer, which is below the FULLSCREEN layer when the flags
+               are processed later. */
+            FLAG_UNSET (c->flags,
+                CLIENT_FLAG_ABOVE | CLIENT_FLAG_BELOW);
+        }
     }
     else
     {

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


More information about the Xfce4-commits mailing list