]> Dogcows Code - chaz/openbox/blobdiff - engines/openbox/openbox.c
add strict ansi compliance
[chaz/openbox] / engines / openbox / openbox.c
index c488efbaf4dbef8cd6e8a92591dec74df6dc9c36..3115df74c477f2c5f7f8a53ab3afbda9b13763da 100644 (file)
@@ -177,7 +177,7 @@ gboolean startup()
     a_unfocused_title = appearance_new(Surface_Planar, 0);
     a_focused_label = appearance_new(Surface_Planar, 1);
     a_unfocused_label = appearance_new(Surface_Planar, 1);
-    a_icon = appearance_new(Surface_Planar, 0);//1);
+    a_icon = appearance_new(Surface_Planar, 0);/*1);*/
     a_focused_handle = appearance_new(Surface_Planar, 0);
     a_unfocused_handle = appearance_new(Surface_Planar, 0);
 
@@ -407,7 +407,7 @@ void frame_adjust_shape(ObFrame *self)
 #endif
 }
 
-void frame_adjust_size(ObFrame *self)
+void frame_adjust_area(ObFrame *self)
 {
     if (self->frame.client->decorations & Decor_Border) {
        self->bwidth = s_bwidth;
@@ -461,11 +461,19 @@ void frame_adjust_size(ObFrame *self)
        XMapWindow(ob_display, self->handle);
     } else
        XUnmapWindow(ob_display, self->handle);
-  
-    XResizeWindow(ob_display, self->frame.window, self->width,
-                 (self->frame.client->shaded ? TITLE_HEIGHT :
-                  self->innersize.top + self->innersize.bottom +
-                  self->frame.client->area.height));
+
+    /* find the new coordinates */
+    self->frame.area.x = self->frame.client->area.x;
+    self->frame.area.y = self->frame.client->area.y;
+    frame_client_gravity((Frame*)self,
+                        &self->frame.area.x, &self->frame.area.y);
+    /* move and resize the top level frame */
+    XMoveResizeWindow(ob_display, self->frame.window,
+                      self->frame.area.x, self->frame.area.y,
+                      self->width,
+                      (self->frame.client->shaded ? TITLE_HEIGHT :
+                       self->innersize.top + self->innersize.bottom +
+                       self->frame.client->area.height));
 
     /* do this in two steps because clients whose gravity is set to
        'Static' don't end up getting moved at all with an XMoveResizeWindow */
@@ -493,16 +501,6 @@ void frame_adjust_size(ObFrame *self)
     frame_adjust_shape(self);
 }
 
-void frame_adjust_position(ObFrame *self)
-{
-    self->frame.area.x = self->frame.client->area.x;
-    self->frame.area.y = self->frame.client->area.y;
-    frame_client_gravity((Frame*)self,
-                        &self->frame.area.x, &self->frame.area.y);
-    XMoveWindow(ob_display, self->frame.window,
-               self->frame.area.x, self->frame.area.y);
-}
-
 void frame_adjust_state(ObFrame *self)
 {
     render_max(self);
@@ -548,8 +546,7 @@ void frame_grab_client(ObFrame *self, Client *client)
     /* map the client so it maps when the frame does */
     XMapWindow(ob_display, client->window);
 
-    frame_adjust_size(self);
-    frame_adjust_position(self);
+    frame_adjust_area(self);
 
     /* set all the windows for the frame in the client_map */
     g_hash_table_insert(client_map, (gpointer)self->frame.window, client);
This page took 0.02383 seconds and 4 git commands to generate.