]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
fixed to accomodate the changes to the render/ API.
[chaz/openbox] / openbox / client.c
index 6d5893e244542add42539fe3757cf09a35e7a309..d7a99def5c6d125fe9b1109cbd0c180ffa96fee6 100644 (file)
@@ -1355,10 +1355,11 @@ void client_update_icons(Client *self)
             self->nicons++;
             self->icons = g_new(Icon, self->nicons);
             xerror_set_ignore(TRUE);
-            if (!render_pixmap_to_rgba(data[0], data[1],
-                                       &self->icons[self->nicons-1].width,
-                                       &self->icons[self->nicons-1].height,
-                                       &self->icons[self->nicons-1].data)) {
+            if (!RrPixmapToRGBA(ob_rr_inst,
+                                data[0], data[1],
+                                &self->icons[self->nicons-1].width,
+                                &self->icons[self->nicons-1].height,
+                                &self->icons[self->nicons-1].data)) {
                 g_free(&self->icons[self->nicons-1]);
                 self->nicons--;
             }
@@ -1373,12 +1374,13 @@ void client_update_icons(Client *self)
                 self->nicons++;
                 self->icons = g_new(Icon, self->nicons);
                 xerror_set_ignore(TRUE);
-                if (!render_pixmap_to_rgba(hints->icon_pixmap,
-                                           (hints->flags & IconMaskHint ?
-                                            hints->icon_mask : None),
-                                           &self->icons[self->nicons-1].width,
-                                           &self->icons[self->nicons-1].height,
-                                           &self->icons[self->nicons-1].data)){
+                if (!RrPixmapToRGBA(ob_rr_inst,
+                                    hints->icon_pixmap,
+                                    (hints->flags & IconMaskHint ?
+                                     hints->icon_mask : None),
+                                    &self->icons[self->nicons-1].width,
+                                    &self->icons[self->nicons-1].height,
+                                    &self->icons[self->nicons-1].data)){
                     g_free(&self->icons[self->nicons-1]);
                     self->nicons--;
                 }
@@ -1677,16 +1679,13 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
             minh = self->base_size.height;
         }
 
-        w -= basew;
-        h -= baseh;
-
         if (user) {
             /* for interactive resizing. have to move half an increment in each
                direction. */
 
             /* how far we are towards the next size inc */
-            int mw = w % self->size_inc.width; 
-            int mh = h % self->size_inc.height;
+            int mw = (w - basew) % self->size_inc.width; 
+            int mh = (h - baseh) % self->size_inc.height;
             /* amount to add */
             int aw = self->size_inc.width / 2;
             int ah = self->size_inc.height / 2;
@@ -1708,6 +1707,9 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
             if (h < minh) h = minh;
         }
 
+        w -= basew;
+        h -= baseh;
+
         /* keep to the increments */
         w /= self->size_inc.width;
         h /= self->size_inc.height;
@@ -1761,7 +1763,11 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
 
     RECT_SET(self->area, x, y, w, h);
 
-    if (final || (resized && config_opaque_resize))
+    /* for app-requested resizes, always resize if 'resized' is true.
+       for user-requested ones, only resize if final is true, or when
+       resizing in opaque mode */
+    if ((!user && resized) ||
+        (user && (final || (resized && config_opaque_resize))))
        XResizeWindow(ob_display, self->window, w, h);
 
     /* move/resize the frame to match the request */
This page took 0.022874 seconds and 4 git commands to generate.