summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-21 18:38:08 +0000
committerDana Jansens <danakj@orodu.net>2003-03-21 18:38:08 +0000
commit327a0b3de75187a23bb01ce5e8e6992fd1106a81 (patch)
tree0c82dedb2972c7cfedc234704c510d6ea71a4e45 /engines
parenta822cbe13b18eca60b220b9b312210c02b946a3b (diff)
always adjust the frames size and position together, so there is no more weird resizing before moving and edge flickering when resizing from the top/left
Diffstat (limited to 'engines')
-rw-r--r--engines/engineinterface.h9
-rw-r--r--engines/openbox/openbox.c33
2 files changed, 18 insertions, 24 deletions
diff --git a/engines/engineinterface.h b/engines/engineinterface.h
index 96796edd..917ebd7c 100644
--- a/engines/engineinterface.h
+++ b/engines/engineinterface.h
@@ -18,12 +18,9 @@ typedef void EngineFrameGrabClient(Frame *self, Client *client);
/* frame_release_client */
typedef void EngineFrameReleaseClient(Frame *self, Client *client);
-/* frame_adjust_size */
-/*! Update the frame's size to match the client */
-typedef void EngineFrameAdjustSize(Frame *self);
-/* frame_adjust_position */
-/*! Update the frame's position to match the client */
-typedef void EngineFrameAdjustPosition(Frame *self);
+/* frame_adjust_area */
+/*! Update the frame's size/position to match the client */
+typedef void EngineFrameAdjustArea(Frame *self);
/* frame_adjust_shape */
/*! Shape the frame window to the client window */
typedef void EngineFrameAdjustShape(Frame *self);
diff --git a/engines/openbox/openbox.c b/engines/openbox/openbox.c
index c488efba..06b36616 100644
--- a/engines/openbox/openbox.c
+++ b/engines/openbox/openbox.c
@@ -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);