]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
add the rgba alpha to the menu entries
[chaz/openbox] / openbox / client.c
index 84cd01c02273c9be0f16a1d9f2314265da240426..0701d3fa3b7d40c616a085b4bd2829e8cbe98efc 100644 (file)
@@ -358,9 +358,13 @@ void client_manage(Window window)
         activate = TRUE;
     }
 
+    /* remove the client's border */
+    XSetWindowBorderWidth(ob_display, self->window, 0);
+
     /* adjust the frame to the client's size before showing or placing
        the window */
     frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
+    frame_adjust_client_area(self->frame);
 
     /* where the frame was placed is where the window was originally */
     placex = self->area.x;
@@ -425,12 +429,8 @@ void client_manage(Window window)
 
         /* fit the window inside the area */
         if (placew > a.width || self->area.height > a.height) {
-            placew = MAX(MIN(MIN(self->area.width, a.width),
-                             self->max_size.width),
-                         self->min_size.width);
-            placeh = MAX(MIN(MIN(self->area.height, a.height),
-                             self->max_size.height),
-                         self->min_size.height);
+            placew = MIN(self->area.width, a.width);
+            placeh = MIN(self->area.height, a.height);
 
             ob_debug("setting window size to %dx%d\n",
                      self->area.width, self->area.height);
@@ -712,6 +712,9 @@ void client_unmanage(ObClient *self)
         self->functions = OB_CLIENT_FUNC_MOVE | OB_CLIENT_FUNC_RESIZE;
         self->decorations = 0; /* unmanaged windows have no decor */
 
+        /* give the client its border back */
+        XSetWindowBorderWidth(ob_display, self->window, self->border_width);
+
         client_move_resize(self, a.x, a.y, a.width, a.height);
     }
 
@@ -1809,7 +1812,7 @@ void client_reconfigure(ObClient *self)
 {
     client_configure(self, self->area.x, self->area.y,
                      self->area.width, self->area.height,
-                     self->border_width, FALSE, TRUE);
+                     FALSE, TRUE);
 }
 
 void client_update_wmhints(ObClient *self)
@@ -2567,7 +2570,7 @@ static void client_apply_startup_state(ObClient *self,
        do this before applying the states so they have the correct
        pre-max/pre-fullscreen values
     */
-    client_configure(self, x, y, w, h, self->border_width, FALSE, TRUE);
+    client_configure(self, x, y, w, h, FALSE, TRUE);
     ob_debug("placed window 0x%x at %d, %d with size %d x %d\n",
              self->window, self->area.x, self->area.y,
              self->area.width, self->area.height);
@@ -2817,7 +2820,7 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
 }
 
 
-void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
+void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
                       gboolean user, gboolean final)
 {
     gint oldw, oldh;
@@ -2838,13 +2841,11 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
 
     /* figure out if we moved or resized or what */
     moved = x != self->area.x || y != self->area.y;
-    resized = w != self->area.width || h != self->area.height ||
-        b != self->border_width;
+    resized = w != self->area.width || h != self->area.height;
 
     oldw = self->area.width;
     oldh = self->area.height;
     RECT_SET(self->area, x, y, w, h);
-    self->border_width = b;
 
     /* for app-requested resizes, always resize if 'resized' is true.
        for user-requested ones, only resize if final is true, or when
@@ -2855,15 +2856,8 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
 
     /* if the client is enlarging, then resize the client before the frame */
     if (send_resize_client && (w > oldw || h > oldh)) {
-        XWindowChanges changes;
-        changes.x = self->frame->size.left - self->border_width;
-        changes.y = self->frame->size.top -self->border_width;
-        changes.width = MAX(w, oldw);
-        changes.height = MAX(h, oldh);
-        changes.border_width = self->border_width;
-        XConfigureWindow(ob_display, self->window,
-                         CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
-                         &changes);
+        XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));
+        frame_adjust_client_area(self->frame);
     }
 
     /* find the frame's dimensions and move/resize it */
@@ -2915,17 +2909,8 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
 
     /* if the client is shrinking, then resize the frame before the client */
     if (send_resize_client && (w <= oldw && h <= oldh)) {
-        if (send_resize_client) {
-            XWindowChanges changes;
-            changes.x = self->frame->size.left - self->border_width;
-            changes.y = self->frame->size.top -self->border_width;
-            changes.width = w;
-            changes.height = h;
-            changes.border_width = self->border_width;
-            XConfigureWindow(ob_display, self->window,
-                             CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
-                             &changes);
-        }
+        frame_adjust_client_area(self->frame);
+        XResizeWindow(ob_display, self->window, w, h);
     }
 
     XFlush(ob_display);
This page took 0.026958 seconds and 4 git commands to generate.