#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"
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);
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);
}
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);
}
}