[Xfce4-commits] [xfce/xfwm4] 01/02: clients: Allow transients to be minimized

noreply at xfce.org noreply at xfce.org
Fri Apr 19 23:30:25 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 bd6481d170cebb56b33a38806e021a5781d82c6c
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Fri Apr 19 22:52:28 2019 +0200

    clients: Allow transients to be minimized
    
    Bug 14953
    
    Until now, xfwm4 would prevent any sort of transients to be minimized.
    
    Allow regular transients windows to be minimized, while still preventing
    dialogs to be minimized independently from their parent window.
    
    Note: This requires a fix in xfce4-panel taskbar to show those windows
    (bug 15307), otherwise the user may not be able to restore the windows
    once hidden.
---
 src/client.c | 32 +++++++++++++++++++++-----------
 src/client.h |  3 +--
 src/netwm.c  |  2 +-
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/src/client.c b/src/client.c
index 6d9fed4..ef043c1 100644
--- a/src/client.c
+++ b/src/client.c
@@ -995,17 +995,27 @@ clientApplyMWMHints (Client *c, gboolean update)
                 }
                 else
                 {
-                    FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_BORDER | XFWM_FLAG_HAS_MENU);
-                    FLAG_SET (c->xfwm_flags, (c->mwm_hints-> decorations & (MWM_DECOR_TITLE | MWM_DECOR_BORDER))
-                                             ? XFWM_FLAG_HAS_BORDER : 0);
-                    FLAG_SET (c->xfwm_flags, (c->mwm_hints->decorations & (MWM_DECOR_MENU))
-                                             ? XFWM_FLAG_HAS_MENU : 0);
-                    /*
-                       FLAG_UNSET(c->xfwm_flags, XFWM_FLAG_HAS_HIDE);
-                       FLAG_UNSET(c->xfwm_flags, XFWM_FLAG_HAS_MAXIMIZE);
-                       FLAG_SET(c->xfwm_flags, (mwm_hints->decorations & (MWM_DECOR_MINIMIZE)) ? XFWM_FLAG_HAS_HIDE : 0);
-                       FLAG_SET(c->xfwm_flags, (mwm_hints->decorations & (MWM_DECOR_MAXIMIZE)) ? XFWM_FLAG_HAS_MAXIMIZE : 0);
-                     */
+                    FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_BORDER |
+                                               XFWM_FLAG_HAS_MENU |
+                                               XFWM_FLAG_HAS_HIDE |
+                                               XFWM_FLAG_HAS_MAXIMIZE);
+
+                    if (c->mwm_hints-> decorations & (MWM_DECOR_TITLE | MWM_DECOR_BORDER))
+                    {
+                        FLAG_SET (c->xfwm_flags,  XFWM_FLAG_HAS_BORDER);
+                    }
+                    if (c->mwm_hints->decorations & MWM_DECOR_MENU)
+                    {
+                        FLAG_SET (c->xfwm_flags, XFWM_FLAG_HAS_MENU);
+                    }
+                    if (c->mwm_hints->decorations & MWM_DECOR_MINIMIZE)
+                    {
+                        FLAG_SET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE);
+                    }
+                    if (c->mwm_hints->decorations & MWM_DECOR_MAXIMIZE)
+                    {
+                        FLAG_SET (c->xfwm_flags, XFWM_FLAG_HAS_MAXIMIZE);
+                    }
                 }
             }
         }
diff --git a/src/client.h b/src/client.h
index 19ef69c..89d2d82 100644
--- a/src/client.h
+++ b/src/client.h
@@ -222,8 +222,7 @@
 #define FLAG_UNSET(flag,bits)                  (flag &= ~(bits))
 #define FLAG_TOGGLE(flag,bits)                 (flag ^= (bits))
 
-#define CLIENT_CAN_HIDE_WINDOW(c)       (!(c->transient_for) && \
-                                         FLAG_TEST(c->xfwm_flags, XFWM_FLAG_HAS_HIDE) && \
+#define CLIENT_CAN_HIDE_WINDOW(c)       (FLAG_TEST(c->xfwm_flags, XFWM_FLAG_HAS_HIDE) && \
                                          !FLAG_TEST(c->flags, CLIENT_FLAG_SKIP_TASKBAR))
 #define CLIENT_CAN_MAXIMIZE_WINDOW(c)   (FLAG_TEST_ALL(c->xfwm_flags, XFWM_FLAG_HAS_MAXIMIZE | \
                                                                       XFWM_FLAG_IS_RESIZABLE) && \
diff --git a/src/netwm.c b/src/netwm.c
index 241f8e8..a6e0394 100644
--- a/src/netwm.c
+++ b/src/netwm.c
@@ -1255,6 +1255,7 @@ clientWindowType (Client * c)
             c->type = WINDOW_DIALOG;
             c->initial_layer = WIN_LAYER_NORMAL;
             /* Treat DIALOG without transient_for set as transient for group */
+            FLAG_SET (c->flags, CLIENT_FLAG_SKIP_TASKBAR);
             if ((c->transient_for == None) || (!clientGetTransient (c)))
             {
                 TRACE ("invalid transient 0x%lx specified for dialog window 0x%lx (%s)",
@@ -1327,7 +1328,6 @@ clientWindowType (Client * c)
             c->initial_layer = c2->win_layer;
             TRACE ("applied layer is %lu", c->initial_layer);
         }
-        FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE);
     }
     if (!FLAG_TEST (c->flags, CLIENT_FLAG_ABOVE|CLIENT_FLAG_BELOW|CLIENT_FLAG_FULLSCREEN))
     {

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


More information about the Xfce4-commits mailing list