X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=2e6ff3f14fb8ace58ebb64d5ba8132a10f581c9a;hb=d38855a0a586c23b26627db5b61ab0531e797061;hp=9a1a81ad6e225e5d9c80a75150f2feb52e90a343;hpb=bd9846e635ea570e076855ece48ec9e80344f728;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 9a1a81ad..2e6ff3f1 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -29,6 +29,7 @@ GPtrArray *screen_desktop_names; static Rect *area = NULL; static Strut *strut = NULL; +static Window support_window = None; static void screen_update_area(); @@ -45,7 +46,6 @@ static int another_running(Display *d, XErrorEvent *e) gboolean screen_annex() { XErrorHandler old; - Window support; pid_t pid; int i, num_support; Atom *supported; @@ -68,14 +68,14 @@ gboolean screen_annex() PROP_SET32(ob_root, openbox_pid, cardinal, pid); /* create the netwm support window */ - support = XCreateSimpleWindow(ob_display, ob_root, 0, 0, 1, 1, 0, 0, 0); + support_window = XCreateSimpleWindow(ob_display, ob_root, 0,0,1,1,0,0,0); /* set supporting window */ - PROP_SET32(ob_root, net_supporting_wm_check, window, support); + PROP_SET32(ob_root, net_supporting_wm_check, window, support_window); /* set properties on the supporting window */ - PROP_SETS(support, net_wm_name, utf8, "Openbox"); - PROP_SET32(support, net_supporting_wm_check, window, support); + PROP_SETS(support_window, net_wm_name, utf8, "Openbox"); + PROP_SET32(support_window, net_supporting_wm_check, window,support_window); /* set the _NET_SUPPORTED_ATOMS hint */ num_support = 48; @@ -167,7 +167,13 @@ void screen_shutdown() { guint i; + XSelectInput(ob_display, ob_root, NoEventMask); + PROP_ERASE(ob_root, openbox_pid); /* we're not running here no more! */ + PROP_ERASE(ob_root, net_supported); /* not without us */ + PROP_ERASE(ob_root, net_showing_desktop); /* don't keep this mode */ + + XDestroyWindow(ob_display, support_window); for (i = 0; i < screen_desktop_names->len; ++i) g_free(g_ptr_array_index(screen_desktop_names, i)); @@ -178,10 +184,10 @@ void screen_shutdown() void screen_resize() { - /* Set the _NET_DESKTOP_GEOMETRY hint */ /* XXX RandR support here? */ int geometry[2]; + /* Set the _NET_DESKTOP_GEOMETRY hint */ geometry[0] = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)); geometry[1] = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)); PROP_SET32A(ob_root, net_desktop_geometry, cardinal, geometry, 2); @@ -272,12 +278,7 @@ void screen_set_desktop(guint num) if (old == num) return; - /* hide windows from bottom to top */ - for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { - Client *c = it->data; - if (c->frame->visible && !client_should_show(c)) - engine_frame_hide(c->frame); - } + /* show windows before hiding the rest to lessen the enter/leave events */ /* show windows from top to bottom */ for (it = stacking_list; it != NULL; it = it->next) { @@ -286,6 +287,13 @@ void screen_set_desktop(guint num) engine_frame_show(c->frame); } + /* hide windows from bottom to top */ + for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { + Client *c = it->data; + if (c->frame->visible && !client_should_show(c)) + engine_frame_hide(c->frame); + } + dispatch_ob(Event_Ob_Desktop, num, old); }