all repos — openbox @ 15d615853671b0988b9a87720cac2762c702f28b

openbox fork - make it a bit more like ryudo

don't force reconfigure in a number of places, also eat enter events when reconfiguring. yay
Dana Jansens danakj@orodu.net
commit

15d615853671b0988b9a87720cac2762c702f28b

parent

1443e17317950d5bb096a55aca81bc8fa419ffe7

6 files changed, 31 insertions(+), 42 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -1749,7 +1749,8 @@

client_change_allowed_actions(self); 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)

@@ -1807,11 +1808,25 @@ else self->max_vert = self->max_horz = FALSE;

} } -void client_reconfigure(ObClient *self) +void client_reconfigure(ObClient *self, gboolean force) { - client_configure(self, self->area.x, self->area.y, - self->area.width, self->area.height, - FALSE, TRUE); + gint x, y, w, h, lw, lh; + + /* 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)

@@ -3254,11 +3269,12 @@ client_showhide(self);

/* raise if it was not already on the desktop */ if (old != DESKTOP_ALL) 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)) 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 */
M openbox/client.hopenbox/client.h

@@ -427,7 +427,7 @@ */

void client_configure(ObClient *self, gint x, gint y, gint w, gint h, 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. @param self The client
M openbox/event.copenbox/event.c

@@ -1434,7 +1434,7 @@ event_end_ignore_all_enters(ignore_start);

/* send a synthetic ConfigureNotify, cuz this is supposed to be like a ConfigureRequest. */ - client_reconfigure(client); + client_reconfigure(client, TRUE); } else ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_RESTACK_WINDOW sent for window %s "

@@ -1481,27 +1481,12 @@ }

msgtype = e->xproperty.atom; if (msgtype == XA_WM_NORMAL_HINTS) { - gint x, y, w, h, lw, lh; - ob_debug("Update NORMAL hints\n"); client_update_normal_hints(client); /* normal hints can make a window non-resizable */ client_setup_decor_and_functions(client, FALSE); - /* 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(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); - } + client_reconfigure(client, FALSE); } else if (msgtype == XA_WM_HINTS) { client_update_wmhints(client); } else if (msgtype == XA_WM_TRANSIENT_FOR) {
M openbox/frame.copenbox/frame.c

@@ -1675,7 +1675,7 @@ XUnmapWindow(ob_display, self->window);

else { /* Send a ConfigureNotify when the animation is done, this fixes 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 ! */
M openbox/openbox.copenbox/openbox.c

@@ -337,7 +337,7 @@ /* redraw the frames */

frame_adjust_area(c->frame, TRUE, TRUE, FALSE); /* the decor sizes may have changed, so the windows may end up in new positions */ - client_reconfigure(c); + client_reconfigure(c, FALSE); } }
M openbox/screen.copenbox/screen.c

@@ -1206,20 +1206,8 @@ PROP_SETA32(RootWindow(ob_display, ob_screen), net_workarea, cardinal,

dims, 4 * screen_num_desktops * screen_num_monitors); /* the area has changed, adjust all the windows if they need it */ - for (it = client_list; it; it = g_list_next(it)) { - gint x, y, w, h, lw, lh; - 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); - } - } + for (it = client_list; it; it = g_list_next(it)) + client_reconfigure(it->data, FALSE); g_free(dims); }