[Xfce4-commits] [xfce/xfwm4] 01/01: netwm: Allow hiding windows using NET_WM_STATE_HIDDEN

noreply at xfce.org noreply at xfce.org
Fri May 3 20:01:13 CEST 2019


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

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit 70832c81246b2590524d3902412875e490f9b2b8
Author: pnd23 at telenet.be <pnd23 at telenet.be>
Date:   Fri May 3 19:57:32 2019 +0200

    netwm: Allow hiding windows using NET_WM_STATE_HIDDEN
    
    Bug 15356
    
    Handle state changes of NET_WM_STATE_HIDDEN to hide or show the client
    window.
---
 src/netwm.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/netwm.c b/src/netwm.c
index a6e0394..a04fe5b 100644
--- a/src/netwm.c
+++ b/src/netwm.c
@@ -333,6 +333,33 @@ clientUpdateNetState (Client * c, XClientMessageEvent * ev)
     second = ev->data.l[2];
     mode = 0;
 
+    if ((first  == display_info->atoms[NET_WM_STATE_HIDDEN]) ||
+        (second == display_info->atoms[NET_WM_STATE_HIDDEN]))
+    {
+        if ((action == NET_WM_STATE_ADD) && !FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
+        {
+            if (CLIENT_CAN_HIDE_WINDOW (c))
+            {
+                clientWithdraw (c, c->win_workspace, TRUE);
+            }
+        }
+        else if ((action == NET_WM_STATE_REMOVE) && FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
+        {
+            clientShow (c, TRUE);
+        }
+        else if (action == NET_WM_STATE_TOGGLE)
+        {
+            if (FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
+            {
+                clientShow (c, TRUE);
+            }
+            else if (CLIENT_CAN_HIDE_WINDOW (c))
+            {
+                clientWithdraw (c, c->win_workspace, TRUE);
+            }
+        }
+    }
+
     if ((first  == display_info->atoms[NET_WM_STATE_SHADED]) ||
         (second == display_info->atoms[NET_WM_STATE_SHADED]))
     {

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


More information about the Xfce4-commits mailing list