From 6226e58beb27a19a3a06996e855d6acdbb1d2995 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan.olivier@wanadoo.fr>
Date: Thu, 16 Jan 2003 11:58:01 +0000
Subject: [PATCH] Constraint client pos only for NORMAL, DIALOG and
 MODAL_DIALOG windows

(Old svn revision: 10837)
---
 src/client.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/client.c b/src/client.c
index a2f879e8c..25647b4d0 100644
--- a/src/client.c
+++ b/src/client.c
@@ -61,6 +61,11 @@
     (c->wmhints->initial_state == IconicState) && \
     !(c->transient_for))
 
+#define CONSTRAINED_WINDOW(c) \
+    ((c->type == WINDOW_NORMAL) || \
+     (c->type == WINDOW_DIALOG) || \
+     (c->type == WINDOW_MODAL_DIALOG))
+
 /* You don't like that ? Me either, but, hell, it's the way glib lists are designed */
 #define XWINDOW_TO_GPOINTER(w)  ((gpointer) (Window) (w))
 #define GPOINTER_TO_XWINDOW(p)  ((Window) (p))
@@ -1361,7 +1366,7 @@ static void clientInitPosition(Client * c)
 
     if(c->size->flags & (PPosition | USPosition))
     {
-        if((c->type != WINDOW_DOCK) && (c->type != WINDOW_DESKTOP))
+        if(CONSTRAINED_WINDOW(c))
         {
             clientKeepVisible(c);
         }
@@ -1373,8 +1378,10 @@ static void clientInitPosition(Client * c)
         /* Center transient relative to their parent window */
         c->x = c2->x + (c2->width - c->width) / 2;
         c->y = c2->y + (c2->height - c->height) / 2;
-        clientKeepVisible(c);
-
+        if(CONSTRAINED_WINDOW(c))
+        {
+            clientKeepVisible(c);
+        }
         return;
     }
 
@@ -2657,7 +2664,7 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent * xevent, gpointer
                 c->y = c->y + 16;
             }
         }
-        if((c->type != WINDOW_DOCK) && (c->type != WINDOW_DESKTOP))
+        if(CONSTRAINED_WINDOW(c))
         {
             clientConstraintPos(c);
         }
@@ -2756,7 +2763,7 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent * xevent, gpointer
             }
         }
 
-        if((c->type != WINDOW_DOCK) && (c->type != WINDOW_DESKTOP))
+        if(CONSTRAINED_WINDOW(c))
         {
             clientConstraintPos(c);
         }
-- 
GitLab