all repos — openbox @ 71badb0790c8595a0ab6dedfbf8027c698369210

openbox fork - make it a bit more like ryudo

move config option loading for the kernel into config.c/h
add options for the number of desktops and the names of the desktops
Dana Jansens danakj@orodu.net
commit

71badb0790c8595a0ab6dedfbf8027c698369210

parent

672f1de2812adc49170414d7abbb2df7db69f34c

M build/Makefile.kernelbuild/Makefile.kernel

@@ -8,7 +8,7 @@ LIBS += $(GLIB_LIBS) $(GMODULE_LIBS) $(XFT_LIBS) $(X_LIBS) $(XINERAMA_LIBS)

LDFLAGS += -export-dynamic target = openbox3 -sources = action.c client.c dispatch.c engine.c event.c group.c \ +sources = action.c client.c config.c dispatch.c engine.c event.c group.c \ extensions.c focus.c frame.c grab.c menu.c openbox.c \ parse.c plugin.c prop.c screen.c stacking.c timer.c xerror.c \ parse.lex.c parse.tab.c
M engines/openbox/obengine.cengines/openbox/obengine.c

@@ -4,7 +4,7 @@ #include "obengine.h"

#include "kernel/openbox.h" #include "kernel/extensions.h" #include "kernel/dispatch.h" -#include "kernel/engine.h" +#include "kernel/config.h" #ifdef HAVE_SYS_STAT_H # include <sys/stat.h>

@@ -703,7 +703,7 @@ n = d = i = l = m = c = s = FALSE;

/* figure out whats being shown, and the width of the label */ self->label_width = self->width - (ob_s_bevel + 1) * 2; - for (lc = engine_layout; *lc != '\0'; ++lc) { + for (lc = config_engine_layout; *lc != '\0'; ++lc) { switch (*lc) { case 'N': if (!(self->frame.client->decorations & Decor_Icon)) break;

@@ -761,7 +761,7 @@ if (!m) XUnmapWindow(ob_display, self->max);

if (!c) XUnmapWindow(ob_display, self->close); x = ob_s_bevel + 1; - for (lc = engine_layout; *lc != '\0'; ++lc) { + for (lc = config_engine_layout; *lc != '\0'; ++lc) { switch (*lc) { case 'N': if (!n) break;
M engines/openbox/obtheme.cengines/openbox/obtheme.c

@@ -1,6 +1,6 @@

#include "obengine.h" #include "kernel/openbox.h" -#include "kernel/engine.h" +#include "kernel/config.h" #include <glib.h> #include <X11/Xlib.h>

@@ -119,7 +119,7 @@

if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) && retvalue.addr != NULL) { - button_dir = g_strdup_printf("%s_buttons", engine_theme); + button_dir = g_strdup_printf("%s_buttons", config_engine_theme); s = g_build_filename(g_get_home_dir(), ".openbox", "themes", "openbox", button_dir, retvalue.addr, NULL);

@@ -136,8 +136,8 @@ else {

char *themename; g_free(s); - themename = g_path_get_basename(engine_theme); - s = g_strdup_printf("%s/%s_buttons/%s", engine_theme, + themename = g_path_get_basename(config_engine_theme); + s = g_strdup_printf("%s/%s_buttons/%s", config_engine_theme, themename, retvalue.addr); g_free(themename); if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) ==

@@ -275,10 +275,10 @@ XrmDatabase db = NULL;

Justify winjust; char *winjuststr; - if (engine_theme) { - db = loaddb(engine_theme); + if (config_engine_theme) { + db = loaddb(config_engine_theme); if (db == NULL) { - g_warning("Failed to load the theme '%s'", engine_theme); + g_warning("Failed to load the theme '%s'", config_engine_theme); g_message("Falling back to the default: '%s'", DEFAULT_THEME); } }

@@ -289,15 +289,15 @@ g_warning("Failed to load the theme '%s'.", DEFAULT_THEME);

return FALSE; } /* set it to what was loaded */ - g_free(engine_theme); - engine_theme = g_strdup(DEFAULT_THEME); + g_free(config_engine_theme); + config_engine_theme = g_strdup(DEFAULT_THEME); } /* load the font, not from the theme file tho, its in the config */ - ob_s_winfont = font_open(engine_font); - ob_s_winfont_height = font_height(ob_s_winfont, engine_shadow, - engine_shadow_offset); + ob_s_winfont = font_open(config_engine_font); + ob_s_winfont_height = font_height(ob_s_winfont, config_engine_shadow, + config_engine_shadow_offset); winjust = Justify_Left; if (read_string(db, "window.justify", &winjuststr)) {

@@ -494,32 +494,37 @@ /* set up the textures */

ob_a_focused_label->texture[0].type = Text; ob_a_focused_label->texture[0].data.text.justify = winjust; ob_a_focused_label->texture[0].data.text.font = ob_s_winfont; - ob_a_focused_label->texture[0].data.text.shadow = engine_shadow; - ob_a_focused_label->texture[0].data.text.offset = engine_shadow_offset; - ob_a_focused_label->texture[0].data.text.tint = engine_shadow_tint; + ob_a_focused_label->texture[0].data.text.shadow = config_engine_shadow; + ob_a_focused_label->texture[0].data.text.offset = + config_engine_shadow_offset; + ob_a_focused_label->texture[0].data.text.tint = config_engine_shadow_tint; ob_a_focused_label->texture[0].data.text.color = ob_s_title_focused_color; ob_app_hilite_label->texture[0].type = Text; ob_app_hilite_label->texture[0].data.text.justify = winjust; ob_app_hilite_label->texture[0].data.text.font = ob_s_winfont; - ob_app_hilite_label->texture[0].data.text.shadow = engine_shadow; - ob_app_hilite_label->texture[0].data.text.offset = engine_shadow_offset; - ob_app_hilite_label->texture[0].data.text.tint = engine_shadow_tint; + ob_app_hilite_label->texture[0].data.text.shadow = config_engine_shadow; + ob_app_hilite_label->texture[0].data.text.offset = + config_engine_shadow_offset; + ob_app_hilite_label->texture[0].data.text.tint = config_engine_shadow_tint; ob_app_hilite_label->texture[0].data.text.color = ob_s_title_focused_color; ob_a_unfocused_label->texture[0].type = Text; ob_a_unfocused_label->texture[0].data.text.justify = winjust; ob_a_unfocused_label->texture[0].data.text.font = ob_s_winfont; - ob_a_unfocused_label->texture[0].data.text.shadow = engine_shadow; - ob_a_unfocused_label->texture[0].data.text.offset = engine_shadow_offset; - ob_a_unfocused_label->texture[0].data.text.tint = engine_shadow_tint; + ob_a_unfocused_label->texture[0].data.text.shadow = config_engine_shadow; + ob_a_unfocused_label->texture[0].data.text.offset = + config_engine_shadow_offset; + ob_a_unfocused_label->texture[0].data.text.tint =config_engine_shadow_tint; ob_a_unfocused_label->texture[0].data.text.color = ob_s_title_unfocused_color; ob_app_unhilite_label->texture[0].type = Text; ob_app_unhilite_label->texture[0].data.text.justify = winjust; ob_app_unhilite_label->texture[0].data.text.font = ob_s_winfont; - ob_app_unhilite_label->texture[0].data.text.shadow = engine_shadow; - ob_app_unhilite_label->texture[0].data.text.offset = engine_shadow_offset; - ob_app_unhilite_label->texture[0].data.text.tint = engine_shadow_tint; + ob_app_unhilite_label->texture[0].data.text.shadow = config_engine_shadow; + ob_app_unhilite_label->texture[0].data.text.offset = + config_engine_shadow_offset; + ob_app_unhilite_label->texture[0].data.text.tint = + config_engine_shadow_tint; ob_app_unhilite_label->texture[0].data.text.color = ob_s_title_unfocused_color;
M openbox/client.copenbox/client.c

@@ -10,6 +10,7 @@ #include "focus.h"

#include "stacking.h" #include "dispatch.h" #include "group.h" +#include "config.h" #include <glib.h> #include <X11/Xutil.h>

@@ -138,7 +139,7 @@ g_free(client_startup_stack_order);

client_startup_stack_order = NULL; client_startup_stack_size = 0; - if (focus_new) + if (config_focus_new) focus_fallback(Fallback_NoFocus); }

@@ -237,7 +238,7 @@ client_showhide(self);

dispatch_client(Event_Client_Mapped, self, 0, 0); - if (ob_state != State_Starting && focus_new) + if (ob_state != State_Starting && config_focus_new) client_focus(self); /* update the list hints */

@@ -1811,13 +1812,13 @@ } else

focus_order[old] = g_list_remove(focus_order[old], self); if (target == DESKTOP_ALL) { for (i = 0; i < screen_num_desktops; ++i) { - if (focus_new) + if (config_focus_new) focus_order[i] = g_list_prepend(focus_order[i], self); else focus_order[i] = g_list_append(focus_order[i], self); } } else { - if (focus_new) + if (config_focus_new) focus_order[target] = g_list_prepend(focus_order[target], self); else focus_order[target] = g_list_append(focus_order[target], self);
A openbox/config.c

@@ -0,0 +1,177 @@

+#include "config.h" +#include "parse.h" + +gboolean config_focus_new; +gboolean config_focus_follow; +gboolean config_focus_last; +gboolean config_focus_last_on_desktop; + +char *config_engine_name; +char *config_engine_theme; +char *config_engine_layout; +char *config_engine_font; +gboolean config_engine_shadow; +int config_engine_shadow_offset; +int config_engine_shadow_tint; + +int config_desktops_num; +GSList *config_desktops_names; + +static void parse_focus(char *name, ParseToken *value) +{ + if (!g_ascii_strcasecmp(name, "focusnew")) { + if (value->type != TOKEN_BOOL) + yyerror("invalid value"); + else { + config_focus_new = value->data.bool; + } + } else if (!g_ascii_strcasecmp(name, "followmouse")) { + if (value->type != TOKEN_BOOL) + yyerror("invalid value"); + else { + config_focus_follow = value->data.bool; + } + } else if (!g_ascii_strcasecmp(name, "focuslast")) { + if (value->type != TOKEN_BOOL) + yyerror("invalid value"); + else { + config_focus_last = value->data.bool; + } + } else if (!g_ascii_strcasecmp(name, "focuslastondesktop")) { + if (value->type != TOKEN_BOOL) + yyerror("invalid value"); + else { + config_focus_last_on_desktop = value->data.bool; + } + } else + yyerror("invalid option"); + parse_free_token(value); +} + +static void parse_engine(char *name, ParseToken *value) +{ + if (!g_ascii_strcasecmp(name, "engine")) { + if (value->type != TOKEN_STRING) + yyerror("invalid value"); + else { + g_free(config_engine_name); + config_engine_name = g_strdup(value->data.string); + } + } else if (!g_ascii_strcasecmp(name, "theme")) { + if (value->type != TOKEN_STRING) + yyerror("invalid value"); + else { + g_free(config_engine_theme); + config_engine_theme = g_strdup(value->data.string); + } + } else if (!g_ascii_strcasecmp(name, "titlebarlayout")) { + if (value->type != TOKEN_STRING) + yyerror("invalid value"); + else { + g_free(config_engine_layout); + config_engine_layout = g_strdup(value->data.string); + } + } else if (!g_ascii_strcasecmp(name, "font.title")) { + if (value->type != TOKEN_STRING) + yyerror("invalid value"); + else { + g_free(config_engine_font); + config_engine_font = g_strdup(value->data.string); + } + } else if (!g_ascii_strcasecmp(name, "font.title.shadow")) { + if (value->type != TOKEN_BOOL) + yyerror("invalid value"); + else { + config_engine_shadow = value->data.bool; + } + } else if (!g_ascii_strcasecmp(name, "font.title.shadow.offset")) { + if (value->type != TOKEN_INTEGER) + yyerror("invalid value"); + else { + config_engine_shadow_offset = value->data.integer; + } + } else if (!g_ascii_strcasecmp(name, "font.title.shadow.tint")) { + if (value->type != TOKEN_INTEGER) + yyerror("invalid value"); + else { + config_engine_shadow_tint = value->data.integer; + if (config_engine_shadow_tint < -100) + config_engine_shadow_tint = -100; + else if (config_engine_shadow_tint > 100) + config_engine_shadow_tint = 100; + } + } else + yyerror("invalid option"); + parse_free_token(value); +} + +static void parse_desktops(char *name, ParseToken *value) +{ + GList *it; + + if (!g_ascii_strcasecmp(name, "number")) { + if (value->type != TOKEN_INTEGER) + yyerror("invalid value"); + else { + config_desktops_num = value->data.integer; + } + } else if (!g_ascii_strcasecmp(name, "names")) { + if (value->type == TOKEN_LIST) { + for (it = value->data.list; it; it = it->next) + if (((ParseToken*)it->data)->type != TOKEN_STRING) break; + if (it == NULL) { + /* build a string list */ + g_free(config_desktops_names); + for (it = value->data.list; it; it = it->next) + config_desktops_names = + g_slist_append(config_desktops_names, + g_strdup + (((ParseToken*)it->data)->data.string)); + } else { + yyerror("invalid string in names list"); + } + } else { + yyerror("syntax error (expected list of strings)"); + } + } else + yyerror("invalid option"); + parse_free_token(value); +} + +void config_startup() +{ + config_focus_new = TRUE; + config_focus_follow = FALSE; + config_focus_last = TRUE; + config_focus_last_on_desktop = TRUE; + + parse_reg_section("focus", NULL, parse_focus); + + config_engine_name = g_strdup(DEFAULT_ENGINE); + config_engine_theme = NULL; + config_engine_layout = g_strdup("NLIMC"); + config_engine_font = g_strdup("Sans-7"); + config_engine_shadow = FALSE; + config_engine_shadow_offset = 1; + config_engine_shadow_tint = 25; + + parse_reg_section("engine", NULL, parse_engine); + + config_desktops_num = 4; + config_desktops_names = NULL; + + parse_reg_section("desktops", NULL, parse_desktops); +} + +void config_shutdown() +{ + GSList *it; + + g_free(config_engine_name); + g_free(config_engine_layout); + g_free(config_engine_font); + + for (it = config_desktops_names; it; it = it->next) + g_free(it->data); + g_slist_free(config_desktops_names); +}
A openbox/config.h

@@ -0,0 +1,39 @@

+#ifndef __config_h +#define __config_h + +#include <glib.h> + +/*! Should new windows be focused */ +extern gboolean config_focus_new; +/*! Focus windows when the mouse enters them */ +extern gboolean config_focus_follow; +/*! Focus the last focused window as a fallback */ +extern gboolean config_focus_last; +/*! Focus the last focused window as a fallback when switching desktops */ +extern gboolean config_focus_last_on_desktop; + +/*! The engine to load */ +extern char *config_engine_name; +/*! The theme to load */ +extern char *config_engine_theme; +/*! The titlebar layout */ +extern char *config_engine_layout; +/*! The titlebar font */ +extern char *config_engine_font; +/*! The titlebar font's shadow */ +extern gboolean config_engine_shadow; +/*! The titlebar font's shadow offset */ +extern int config_engine_shadow_offset; +/*! The titlebar font's shadow transparency */ +extern int config_engine_shadow_tint; + +/*! The number of desktops */ +extern int config_desktops_num; +/*! Names for the desktops */ +extern GSList *config_desktops_names; + + +void config_startup(); +void config_shutdown(); + +#endif
M openbox/engine.copenbox/engine.c

@@ -1,19 +1,11 @@

#include "engine.h" -#include "parse.h" +#include "config.h" #include <glib.h> #include <gmodule.h> #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif - -char *engine_name; -char *engine_theme; -char *engine_layout; -char *engine_font; -gboolean engine_shadow; -int engine_shadow_offset; -int engine_shadow_tint; EngineFrameNew *engine_frame_new; EngineFrameGrabClient *engine_frame_grab_client;

@@ -86,80 +78,16 @@

return TRUE; } -static void parse_assign(char *name, ParseToken *value) -{ - if (!g_ascii_strcasecmp(name, "engine")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_name); - engine_name = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "theme")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_theme); - engine_theme = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "titlebarlayout")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_layout); - engine_layout = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "font.title")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_font); - engine_font = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "font.title.shadow")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else { - engine_shadow = value->data.bool; - } - } else if (!g_ascii_strcasecmp(name, "font.title.shadow.offset")) { - if (value->type != TOKEN_INTEGER) - yyerror("invalid value"); - else { - engine_shadow_offset = value->data.integer; - } - } else if (!g_ascii_strcasecmp(name, "font.title.shadow.tint")) { - if (value->type != TOKEN_INTEGER) - yyerror("invalid value"); - else { - engine_shadow_tint = value->data.integer; - if (engine_shadow_tint < -100) engine_shadow_tint = -100; - else if (engine_shadow_tint > 100) engine_shadow_tint = 100; - } - } else - yyerror("invalid option"); - parse_free_token(value); -} - void engine_startup() { module = NULL; - engine_name = g_strdup(DEFAULT_ENGINE); - engine_theme = NULL; - engine_layout = g_strdup("NLIMC"); - engine_font = g_strdup("Sans-7"); - engine_shadow = FALSE; - engine_shadow_offset = 1; - engine_shadow_tint = 25; - - parse_reg_section("engine", NULL, parse_assign); } void engine_load() { - if (load(engine_name)) + if (load(config_engine_name)) return; - g_warning("Failed to load the engine '%s'", engine_name); + g_warning("Failed to load the engine '%s'", config_engine_name); g_message("Falling back to the default: '%s'", DEFAULT_ENGINE); if (module != NULL) { g_module_close(module);

@@ -173,7 +101,6 @@ }

void engine_shutdown() { - g_free(engine_name); if (module != NULL) { eshutdown(); g_module_close(module);
M openbox/engine.hopenbox/engine.h

@@ -3,21 +3,6 @@ #define __engine_h

#include "../engines/engineinterface.h" -/* The engine to load */ -extern char *engine_name; -/* The theme to load */ -extern char *engine_theme; -/* The titlebar layout */ -extern char *engine_layout; -/* The titlebar font */ -extern char *engine_font; -/* The titlebar font's shadow */ -extern gboolean engine_shadow; -/* The titlebar font's shadow offset */ -extern int engine_shadow_offset; -/* The titlebar font's shadow transparency */ -extern int engine_shadow_tint; - void engine_startup(); void engine_load(); void engine_shutdown();
M openbox/event.copenbox/event.c

@@ -2,6 +2,7 @@ #include "openbox.h"

#include "client.h" #include "xerror.h" #include "prop.h" +#include "config.h" #include "screen.h" #include "frame.h" #include "engine.h"

@@ -388,7 +389,7 @@ focus_order[desktop] = g_list_remove(focus_order[desktop],

client); focus_order[desktop] = g_list_prepend(focus_order[desktop], client); - } else if (focus_follow) { + } else if (config_focus_follow) { #ifdef DEBUG_FOCUS g_message("EnterNotify on %lx, focusing window", client->window);
M openbox/focus.copenbox/focus.c

@@ -1,6 +1,7 @@

#include "event.h" #include "openbox.h" #include "client.h" +#include "config.h" #include "frame.h" #include "screen.h" #include "group.h"

@@ -18,44 +19,9 @@ GList **focus_order = NULL; /* these lists are created when screen_startup

sets the number of desktops */ Window focus_backup = None; -gboolean focus_new = TRUE; -gboolean focus_follow = FALSE; -static gboolean focus_last = TRUE; -static gboolean focus_last_on_desktop = TRUE; static gboolean noreorder = 0; -static void parse_assign(char *name, ParseToken *value) -{ - if (!g_ascii_strcasecmp(name, "focusnew")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else { - focus_new = value->data.bool; - } - } else if (!g_ascii_strcasecmp(name, "followmouse")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else { - focus_follow = value->data.bool; - } - } else if (!g_ascii_strcasecmp(name, "focuslast")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else { - focus_last = value->data.bool; - } - } else if (!g_ascii_strcasecmp(name, "focuslastondesktop")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else { - focus_last_on_desktop = value->data.bool; - } - } else - yyerror("invalid option"); - parse_free_token(value); -} - void focus_startup() { /* create the window which gets focus when no clients get it. Have to

@@ -64,10 +30,6 @@ mapped. */

XSetWindowAttributes attrib; focus_client = NULL; - focus_new = TRUE; - focus_follow = FALSE; - focus_last = TRUE; - focus_last_on_desktop = TRUE; attrib.override_redirect = TRUE; focus_backup = XCreateWindow(ob_display, ob_root,

@@ -78,8 +40,6 @@ XMapRaised(ob_display, focus_backup);

/* start with nothing focused */ focus_set_client(NULL); - - parse_reg_section("focus", NULL, parse_assign); } void focus_shutdown()

@@ -176,8 +136,9 @@ at all for them.

*/ focus_set_client(NULL); - if (!(type == Fallback_Desktop ? focus_last_on_desktop : focus_last)) { - if (focus_follow) focus_under_pointer(); + if (!(type == Fallback_Desktop ? + config_focus_last_on_desktop : config_focus_last)) { + if (config_focus_follow) focus_under_pointer(); return; }
M openbox/focus.hopenbox/focus.h

@@ -15,11 +15,6 @@

/*! The recent focus order on each desktop */ extern GList **focus_order; -/*! Should new windows be focused */ -extern gboolean focus_new; -/*! Focus windows when the mouse enters them */ -extern gboolean focus_follow; - void focus_startup(); void focus_shutdown();
M openbox/openbox.copenbox/openbox.c

@@ -13,6 +13,7 @@ #include "engine.h"

#include "plugin.h" #include "timer.h" #include "group.h" +#include "config.h" #include "gettext.h" #include "../render/render.h" #include "../render/font.h"

@@ -159,11 +160,12 @@ font_startup();

event_startup(); grab_startup(); engine_startup(); - focus_startup(); plugin_startup(); /* load the plugins specified in the pluginrc */ plugin_loadall(); + /* set up the kernel config shit */ + config_startup(); /* parse/load user options */ parse_rc(); /* we're done with parsing now, kill it */

@@ -172,6 +174,7 @@

/* load the engine specified in the rc */ engine_load(); + focus_startup(); screen_startup(); group_startup(); client_startup();

@@ -199,6 +202,7 @@ grab_shutdown();

event_shutdown(); render_shutdown(); timer_shutdown(); + config_shutdown(); } dispatch_shutdown();
M openbox/prop.copenbox/prop.c

@@ -265,6 +265,20 @@ }

return FALSE; } +void prop_set_strings(Window win, Atom prop, Atom type, GPtrArray *data) +{ + GString *str; + guint i; + + str = g_string_sized_new(0); + for (i = 0; i < data->len; ++i) { + str = g_string_append(str, data->pdata[i]); + str = g_string_append_c(str, '\0'); + } + XChangeProperty(ob_display, win, prop, type, 8, + PropModeReplace, (guchar*)str->str, str->len); +} + void prop_erase(Window win, Atom prop) { XDeleteProperty(ob_display, win, prop);
M openbox/screen.copenbox/screen.c

@@ -1,5 +1,6 @@

#include "openbox.h" #include "prop.h" +#include "config.h" #include "screen.h" #include "client.h" #include "frame.h"

@@ -148,13 +149,23 @@ }

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);