diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-03-17 02:03:45 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-03-17 02:03:45 +0000 |
| commit | 216a04bdd057c03a719a0908cd003503b4f73fdb (patch) | |
| tree | ec77856103bc1ebfcbf4ab60b536c06a7479e3ea /openbox/screen.c | |
| parent | 432ac0983e058133e03885171f266dc4ba07f488 (diff) | |
speed up workspace switching by causing the minimal number of expose events (none for the hiding windows!)
Diffstat (limited to 'openbox/screen.c')
| -rw-r--r-- | openbox/screen.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/openbox/screen.c b/openbox/screen.c index d077c495..3c83baa4 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -2,6 +2,8 @@ #include "prop.h" #include "screen.h" #include "client.h" +#include "frame.h" +#include "engine.h" #include "focus.h" #include <X11/Xlib.h> @@ -251,8 +253,19 @@ 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) @@ -356,15 +369,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); } } |
