]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
debug print modified and the confignotify test
[chaz/openbox] / openbox / client.c
index b69df9e09f47bb5065ce62cff793a297dc24fa47..aa0d8fafc4f77f836e34a33cf63304c24c470fdb 100644 (file)
@@ -400,15 +400,17 @@ void client_manage(Window window)
             a.height -= self->frame->size.top + self->frame->size.bottom;
 
             /* fit the window inside the area */
-            self->area.width = MIN(self->area.width, a.width);
-            self->area.height = MIN(self->area.height, a.height);
+            if (self->area.width > a.width || self->area.height > a.height) {
+                self->area.width = MIN(self->area.width, a.width);
+                self->area.height = MIN(self->area.height, a.height);
 
-            ob_debug("setting window size to %dx%d\n",
-                     self->area.width, self->area.height);
+                ob_debug("setting window size to %dx%d\n",
+                         self->area.width, self->area.height);
 
-            /* adjust the frame to the client's new size */
-            frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
-            frame_adjust_client_area(self->frame);
+                /* adjust the frame to the client's new size */
+                frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
+                frame_adjust_client_area(self->frame);
+            }
         }
 
         /* make sure the window is visible. */
@@ -1108,8 +1110,8 @@ static void client_get_area(ObClient *self)
     POINT_SET(self->root_pos, wattrib.x, wattrib.y);
     self->border_width = wattrib.border_width;
 
-    ob_debug("client area: %d %d  %d %d\n", wattrib.x, wattrib.y,
-             wattrib.width, wattrib.height);
+    ob_debug("client area: %d %d  %d %d  bw %d\n", wattrib.x, wattrib.y,
+             wattrib.width, wattrib.height, wattrib.border_width);
 }
 
 static void client_get_desktop(ObClient *self)
@@ -1800,9 +1802,6 @@ static void client_change_allowed_actions(ObClient *self)
 
 void client_reconfigure(ObClient *self)
 {
-    /* by making this pass FALSE for user, we avoid the emacs event storm where
-       every configurenotify causes an update in its normal hints, i think this
-       is generally what we want anyways... */
     client_configure(self, self->area.x, self->area.y,
                      self->area.width, self->area.height,
                      self->border_width, FALSE, TRUE);
@@ -2826,8 +2825,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
         changes.height = MAX(h, oldh);
         changes.border_width = self->border_width;
         XConfigureWindow(ob_display, self->window,
-                         (moved ? CWX|CWY : 0) |
-                         (resized ? CWWidth|CWHeight|CWBorderWidth : 0),
+                         CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
                          &changes);
         /* resize the plate to show the client padding color underneath */
         frame_adjust_client_area(self->frame);
@@ -2874,14 +2872,14 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
         event.xconfigure.width = w;
         event.xconfigure.height = h;
         event.xconfigure.border_width = self->border_width;
-        event.xconfigure.above = self->frame->plate;
+        event.xconfigure.above = None;
         event.xconfigure.override_redirect = FALSE;
         XSendEvent(event.xconfigure.display, event.xconfigure.window,
                    FALSE, StructureNotifyMask, &event);
     }
 
     /* if the client is shrinking, then resize the frame before the client */
-    if (send_resize_client && (w <= oldw || h <= oldh)) {
+    if (send_resize_client && (w <= oldw && h <= oldh)) {
         /* resize the plate to show the client padding color underneath */
         frame_adjust_client_area(self->frame);
 
@@ -2893,8 +2891,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
             changes.height = h;
             changes.border_width = self->border_width;
             XConfigureWindow(ob_display, self->window,
-                             (moved ? CWX|CWY : 0) |
-                             (resized ? CWWidth|CWHeight|CWBorderWidth : 0),
+                             CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
                              &changes);
         }
     }
This page took 0.021903 seconds and 4 git commands to generate.