don't force reconfigure in a number of places, also eat enter events when reconfiguring. yay

This commit is contained in:
Dana Jansens 2007-06-13 15:07:49 +00:00
parent 1443e17317
commit 15d6158536
6 changed files with 31 additions and 42 deletions

View file

@ -1749,7 +1749,8 @@ void client_setup_decor_and_functions(ObClient *self, gboolean reconfig)
client_change_allowed_actions(self); client_change_allowed_actions(self);
if (reconfig) if (reconfig)
client_reconfigure(self); /* force reconfigure to make sure decorations are updated */
client_reconfigure(self, TRUE);
} }
static void client_change_allowed_actions(ObClient *self) static void client_change_allowed_actions(ObClient *self)
@ -1807,11 +1808,25 @@ static void client_change_allowed_actions(ObClient *self)
} }
} }
void client_reconfigure(ObClient *self) void client_reconfigure(ObClient *self, gboolean force)
{ {
client_configure(self, self->area.x, self->area.y, gint x, y, w, h, lw, lh;
self->area.width, self->area.height,
FALSE, TRUE); /* make sure the client's sizes are within its bounds, but only
reconfigure the window if it needs to. emacs will update its
normal hints every time it receives a conigurenotify */
RECT_TO_DIMS(self->area, x, y, w, h);
if (!force)
client_try_configure(self, &x, &y, &w, &h, &lw, &lh, FALSE);
if (force || !RECT_EQUAL_DIMS(self->area, x, y, w, h)) {
gulong ignore_start;
ob_debug("Reconfiguring client x %d y %d w %d h %d\n",
x, y, w, h);
ignore_start = event_start_ignore_all_enters();
client_configure(self, x, y, w, h, FALSE, TRUE);
event_end_ignore_all_enters(ignore_start);
}
} }
void client_update_wmhints(ObClient *self) void client_update_wmhints(ObClient *self)
@ -3254,11 +3269,12 @@ void client_set_desktop_recursive(ObClient *self,
/* raise if it was not already on the desktop */ /* raise if it was not already on the desktop */
if (old != DESKTOP_ALL) if (old != DESKTOP_ALL)
stacking_raise(CLIENT_AS_WINDOW(self)); stacking_raise(CLIENT_AS_WINDOW(self));
/* the new desktop's geometry may be different, so we may need to
resize, for example if we are maximized */
client_reconfigure(self);
if (STRUT_EXISTS(self->strut)) if (STRUT_EXISTS(self->strut))
screen_update_areas(); screen_update_areas();
else
/* the new desktop's geometry may be different, so we may need to
resize, for example if we are maximized */
client_reconfigure(self, FALSE);
} }
/* move all transients */ /* move all transients */

View file

@ -427,7 +427,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, void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
gboolean user, gboolean final); gboolean user, gboolean final);
void client_reconfigure(ObClient *self); void client_reconfigure(ObClient *self, gboolean force);
/*! Finds coordinates to keep a client on the screen. /*! Finds coordinates to keep a client on the screen.
@param self The client @param self The client

View file

@ -1434,7 +1434,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
/* send a synthetic ConfigureNotify, cuz this is supposed /* send a synthetic ConfigureNotify, cuz this is supposed
to be like a ConfigureRequest. */ to be like a ConfigureRequest. */
client_reconfigure(client); client_reconfigure(client, TRUE);
} else } else
ob_debug_type(OB_DEBUG_APP_BUGS, ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_RESTACK_WINDOW sent for window %s " "_NET_RESTACK_WINDOW sent for window %s "
@ -1481,27 +1481,12 @@ static void event_handle_client(ObClient *client, XEvent *e)
msgtype = e->xproperty.atom; msgtype = e->xproperty.atom;
if (msgtype == XA_WM_NORMAL_HINTS) { if (msgtype == XA_WM_NORMAL_HINTS) {
gint x, y, w, h, lw, lh;
ob_debug("Update NORMAL hints\n"); ob_debug("Update NORMAL hints\n");
client_update_normal_hints(client); client_update_normal_hints(client);
/* normal hints can make a window non-resizable */ /* normal hints can make a window non-resizable */
client_setup_decor_and_functions(client, FALSE); client_setup_decor_and_functions(client, FALSE);
/* make sure the client's sizes are within its bounds, but only client_reconfigure(client, FALSE);
reconfigure the window if it needs to. emacs will update its
normal hints every time it receives a conigurenotify */
RECT_TO_DIMS(client->area, x, y, w, h);
client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE);
if (!RECT_EQUAL_DIMS(client->area, x, y, w, h)) {
gulong ignore_start;
ob_debug("Configuring client x %d y %d w %d h %d\n",
x, y, w, h);
ignore_start = event_start_ignore_all_enters();
client_configure(client, x, y, w, h, FALSE, TRUE);
event_end_ignore_all_enters(ignore_start);
}
} else if (msgtype == XA_WM_HINTS) { } else if (msgtype == XA_WM_HINTS) {
client_update_wmhints(client); client_update_wmhints(client);
} else if (msgtype == XA_WM_TRANSIENT_FOR) { } else if (msgtype == XA_WM_TRANSIENT_FOR) {

View file

@ -1675,7 +1675,7 @@ void frame_end_iconify_animation(ObFrame *self)
else { else {
/* Send a ConfigureNotify when the animation is done, this fixes /* Send a ConfigureNotify when the animation is done, this fixes
KDE's pager showing the window in the wrong place. */ KDE's pager showing the window in the wrong place. */
client_reconfigure(self->client); client_reconfigure(self->client, TRUE);
} }
/* we're not animating any more ! */ /* we're not animating any more ! */

View file

@ -337,7 +337,7 @@ gint main(gint argc, gchar **argv)
frame_adjust_area(c->frame, TRUE, TRUE, FALSE); frame_adjust_area(c->frame, TRUE, TRUE, FALSE);
/* the decor sizes may have changed, so the windows may /* the decor sizes may have changed, so the windows may
end up in new positions */ end up in new positions */
client_reconfigure(c); client_reconfigure(c, FALSE);
} }
} }

View file

@ -1206,20 +1206,8 @@ void screen_update_areas()
dims, 4 * screen_num_desktops * screen_num_monitors); dims, 4 * screen_num_desktops * screen_num_monitors);
/* the area has changed, adjust all the windows if they need it */ /* the area has changed, adjust all the windows if they need it */
for (it = client_list; it; it = g_list_next(it)) { for (it = client_list; it; it = g_list_next(it))
gint x, y, w, h, lw, lh; client_reconfigure(it->data, FALSE);
ObClient *client = it->data;
RECT_TO_DIMS(client->area, x, y, w, h);
client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE);
if (!RECT_EQUAL_DIMS(client->area, x, y, w, h)) {
gulong ignore_start;
ignore_start = event_start_ignore_all_enters();
client_configure(client, x, y, w, h, FALSE, TRUE);
event_end_ignore_all_enters(ignore_start);
}
}
g_free(dims); g_free(dims);
} }