X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=f82275c0a66738e43c7eacafa39cb44d0756d8ab;hb=ccc5f020514e9c3e0a2a8e858eacc6d0140675a3;hp=d077c495e74b1f7c79b67f96ec028de4cc4ea228;hpb=f8a47de5ec444c452093371e3db16857eb39a490;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index d077c495..f82275c0 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -2,7 +2,11 @@ #include "prop.h" #include "screen.h" #include "client.h" +#include "frame.h" +#include "engine.h" #include "focus.h" +#include "dispatch.h" +#include "../render/render.h" #include #ifdef HAVE_UNISTD_H @@ -231,6 +235,8 @@ void screen_set_num_desktops(guint num) /* may be some unnamed desktops that we need to fill in with names */ screen_update_desktop_names(); + dispatch_ob(Event_Ob_NumDesktops); + /* change our desktop if we're on one that no longer exists! */ if (screen_desktop >= screen_num_desktops) screen_set_desktop(num - 1); @@ -251,12 +257,21 @@ void screen_set_desktop(guint num) if (old == num) return; - for (it = stacking_list; it != NULL; it = it->next) - client_showhide(it->data, FALSE); + /* 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 from top to bottom */ + for (it = stacking_list; it != NULL; it = it->next) { + Client *c = it->data; + if (!c->frame->visible && client_should_show(c)) + engine_frame_show(c->frame); + } - /* force the callbacks to fire */ - if (focus_client == NULL) - focus_set_client(NULL); + dispatch_ob(Event_Ob_Desktop); } void screen_update_layout() @@ -356,15 +371,15 @@ void screen_show_desktop(gboolean show) Client *client = it->data; if (client->type == Type_Desktop) client_focus(client); - else - client_showhide(client, FALSE); + else if (client->frame->visible && !client_should_show(client)) + engine_frame_hide(client->frame); } } else { /* top to bottom */ for (it = stacking_list; it != NULL; it = it->next) { Client *client = it->data; - if (client->type != Type_Desktop) - client_showhide(client, FALSE); + if (!client->frame->visible && client_should_show(client)) + engine_frame_show(client->frame); } } @@ -379,18 +394,17 @@ void screen_show_desktop(gboolean show) show = show ? 1 : 0; /* make it boolean */ PROP_SET32(ob_root, net_showing_desktop, cardinal, show); + + dispatch_ob(Event_Ob_ShowDesktop); } void screen_install_colormap(Client *client, gboolean install) { if (client == NULL) { - /* XXX DONT USE THE DEFAULT SHIT HERE */ if (install) - XInstallColormap(ob_display, - DefaultColormap(ob_display, ob_screen)); + XInstallColormap(ob_display, render_colormap); else - XUninstallColormap(ob_display, - DefaultColormap(ob_display, ob_screen)); + XUninstallColormap(ob_display, render_colormap); } else { XWindowAttributes wa; if (XGetWindowAttributes(ob_display, client->window, &wa)) {