]> Dogcows Code - chaz/openbox/commitdiff
use the PSize and USSize hints to decide to resize windows on map or not
authorDana Jansens <danakj@orodu.net>
Sat, 26 May 2007 15:38:54 +0000 (15:38 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 26 May 2007 15:38:54 +0000 (15:38 +0000)
openbox/client.c
openbox/client.h

index 4a3e8c372510225b5835b51da31c59689c162c6a..573c271c8cb8eb2049bc14e5818cb35704056bfd 100644 (file)
@@ -381,13 +381,21 @@ void client_manage(Window window)
                      "program + user specified" :
                      "BADNESS !?")))), self->area.x, self->area.y);
 
+        ob_debug("Sized: %s @ %d %d\n",
+                 (!self->sized ? "no" :
+                  (self->sized == PSize ? "program specified" :
+                   (self->sized == USSize ? "user specified" :
+                    (self->sized == PSize | USSize ?
+                     "program + user specified" :
+                     "BADNESS !?")))), self->area.width, self->area.height);
+
         transient = place_client(self, &placex, &placey, settings);
 
         /* if the window isn't user-positioned, then make it fit inside
            the visible screen area on its monitor.
 
            the monitor is chosen by place_client! */
-        if (!(self->positioned & USPosition)) {
+        if (!(self->sized & USSize)) {
             /* make a copy to modify */
             Rect a = *screen_area_monitor(self->desktop, client_monitor(self));
 
@@ -867,6 +875,7 @@ static void client_restore_session_state(ObClient *self)
 
     RECT_SET_POINT(self->area, self->session->x, self->session->y);
     self->positioned = USPosition;
+    self->sized = USSize;
     if (self->session->w > 0)
         self->area.width = self->session->w;
     if (self->session->h > 0)
@@ -1617,6 +1626,7 @@ void client_update_normal_hints(ObClient *self)
         if (!client_normal(self))
         */
         self->positioned = (size.flags & (PPosition|USPosition));
+        self->sized = (size.flags & (PSize|USSize));
 
         if (size.flags & PWinGravity)
             self->gravity = size.win_gravity;
index 82a565f3fd692f7e64200f8789a5be66081b2ff6..e4831b95341af4c09de21b49688681b4dec6826e 100644 (file)
@@ -216,6 +216,10 @@ struct _ObClient
       we only force it if it tries to go completely offscreen, if neither, we
       should place the window ourselves when it first appears */
     guint positioned;
+
+    /*! Was the window's size requested by the application or the user?
+      If by the application we don't let it go outside the available area */
+    guint sized;
   
     /*! Can the window receive input focus? */
     gboolean can_focus;
This page took 0.033522 seconds and 4 git commands to generate.