X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=4b91a6dd23f9812700adfe2152a55e4b968c34e1;hb=3fd74abb3c2969f170d727154245cde3ef8a4b87;hp=2ff950ab6e5da36071715c75d31c16ea2cece39e;hpb=197ee0ad4732c8668fe38a6b49e0a747866ef3ea;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 2ff950ab..4b91a6dd 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -36,6 +36,7 @@ #include "obrender/render.h" #include "gettext.h" #include "obt/display.h" +#include "obt/xqueue.h" #include "obt/prop.h" #include "obt/mainloop.h" @@ -129,14 +130,16 @@ static gboolean replace_wm(void) /* Wait for old window manager to go away */ if (current_wm_sn_owner) { - XEvent event; gulong wait = 0; const gulong timeout = G_USEC_PER_SEC * 15; /* wait for 15s max */ + ObtXQueueWindowType wt; + + wt.window = current_wm_sn_owner; + wt.type = DestroyNotify; while (wait < timeout) { - if (XCheckWindowEvent(obt_display, current_wm_sn_owner, - StructureNotifyMask, &event) && - event.type == DestroyNotify) + /* Checks the local queue and incoming events for this event */ + if (xqueue_exists_local(xqueue_match_window_type, &wt)) break; g_usleep(G_USEC_PER_SEC / 10); wait += G_USEC_PER_SEC / 10; @@ -1371,7 +1374,14 @@ void screen_update_areas(void) { guint i; gulong *dims; - GList *it; + GList *it, *onscreen; + + /* collect the clients that are on screen */ + onscreen = NULL; + for (it = client_list; it; it = g_list_next(it)) { + if (client_monitor(it->data) != screen_num_monitors) + onscreen = g_list_prepend(onscreen, it->data); + } g_free(monitor_area); get_xinerama_screens(&monitor_area, &screen_num_monitors); @@ -1445,8 +1455,10 @@ void screen_update_areas(void) dims, 4 * screen_num_desktops); /* the area has changed, adjust all the windows if they need it */ - for (it = client_list; it; it = g_list_next(it)) + for (it = onscreen; it; it = g_list_next(it)) { + client_move_onscreen(it->data, FALSE); client_reconfigure(it->data, FALSE); + } g_free(dims); }