X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=9f14ea8cb68f735d3952005920986be890fb2b8f;hb=58ba751ab71e99202b1f8d2c5d8dd75373a50905;hp=3145a63c1d09f269ed8efe31b061da8cbb33cfd5;hpb=cbbf90a718ecc6836ef7a77b9040aebb9da348b8;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 3145a63c..9f14ea8c 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -1,9 +1,9 @@ #include "openbox.h" #include "prop.h" +#include "config.h" #include "screen.h" #include "client.h" #include "frame.h" -#include "engine.h" #include "focus.h" #include "dispatch.h" #include "../render/render.h" @@ -148,13 +148,23 @@ gboolean screen_annex() void screen_startup() { + GSList *it; + screen_desktop_names = g_ptr_array_new(); /* get the initial size */ screen_resize(); + /* set the names */ + for (it = config_desktops_names; it; it = it->next) + g_ptr_array_add(screen_desktop_names, it->data); /* dont strdup */ + PROP_SETSA(ob_root, net_desktop_names, utf8, screen_desktop_names); + g_ptr_array_set_size(screen_desktop_names, 0); /* rm the ptrs so they dont + get frees when we + update the desktop + names */ screen_num_desktops = 0; - screen_set_num_desktops(4); + screen_set_num_desktops(config_desktops_num); screen_desktop = 0; screen_set_desktop(0); @@ -276,21 +286,21 @@ void screen_set_desktop(guint num) 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); + 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); + frame_hide(c->frame); } /* focus the last focused window on the desktop, and ignore enter events from the switch so it doesnt mess with the focus */ XSync(ob_display, FALSE); while (XCheckTypedEvent(ob_display, EnterNotify, &e)); - focus_fallback(TRUE); + focus_fallback(Fallback_Desktop); dispatch_ob(Event_Ob_Desktop, num, old); } @@ -385,14 +395,14 @@ void screen_show_desktop(gboolean show) for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { Client *client = it->data; if (client->frame->visible && !client_should_show(client)) - engine_frame_hide(client->frame); + frame_hide(client->frame); } } else { /* top to bottom */ for (it = stacking_list; it != NULL; it = it->next) { Client *client = it->data; if (!client->frame->visible && client_should_show(client)) - engine_frame_show(client->frame); + frame_show(client->frame); } }