summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-01 05:21:09 +0000
committerDana Jansens <danakj@orodu.net>2007-06-01 05:21:09 +0000
commitaf42ac2a535d3625e689c3e60bc525f8a455fcd6 (patch)
tree92c7da2193f125031d29d836f66b57950685ac14
parent32b64b6cf5876364c891b97bd5227cc53aeac17b (diff)
less configure events on mapping
-rw-r--r--openbox/client.c19
-rw-r--r--openbox/frame.c5
2 files changed, 16 insertions, 8 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 14d22103..e5666c0a 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -2566,6 +2566,8 @@ static void client_apply_startup_state(ObClient *self,
gboolean demands_attention = self->demands_attention;
gboolean max_horz = self->max_horz;
gboolean max_vert = self->max_vert;
+ Rect oldarea;
+ gint l;
/* turn them all off in the client, so they won't affect the window
being placed */
@@ -2581,10 +2583,12 @@ 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, FALSE, TRUE);
+ client_try_configure(self, &x, &y, &w, &h, &l, &l, FALSE);
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);
+ oldarea = self->area; /* save the area */
+ RECT_SET(self->area, x, y, w, h); /* put where it should be for the premax stuff */
/* apply the states. these are in a carefully crafted order.. */
@@ -2606,6 +2610,12 @@ static void client_apply_startup_state(ObClient *self,
else if (max_horz)
client_maximize(self, TRUE, 1);
+ /* if the window hasn't been configured yet, then do so now */
+ if (!fullscreen && !max_vert && !max_horz) {
+ self->area = oldarea;
+ client_configure(self, x, y, w, h, FALSE, TRUE);
+ }
+
/* set the desktop hint, to make sure that it always exists */
PROP_SET32(self->window, net_wm_desktop, cardinal, self->desktop);
@@ -2931,13 +2941,6 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
self->frame->size.left, self->frame->size.top, w, h);
}
- if (!resized) {
- /* when the client has StaticGravity, it likes to move around.
- also this correctly positions the client when it maps */
- XMoveWindow(ob_display, self->window,
- self->frame->size.left, self->frame->size.top);
- }
-
XFlush(ob_display);
}
diff --git a/openbox/frame.c b/openbox/frame.c
index a8391e48..89358ac2 100644
--- a/openbox/frame.c
+++ b/openbox/frame.c
@@ -764,6 +764,11 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
self->area.width,
self->area.height);
+ /* when the client has StaticGravity, it likes to move around.
+ also this correctly positions the client when it maps */
+ XMoveWindow(ob_display, self->client->window,
+ self->size.left, self->size.top);
+
if (resized) {
framerender_frame(self);
frame_adjust_shape(self);