all repos — openbox @ 77af27b8b23024231d3c013c45c7a9ce77aeda53

openbox fork - make it a bit more like ryudo

add setting <desktops><firstdesk>num<//> to set which desktop to start on, also fix a guint that should be gint. (used to let you say you want negative number of desktops)
Mikael Magnusson mikachu@comhem.se
commit

77af27b8b23024231d3c013c45c7a9ce77aeda53

parent

3c28739a0e816114826303f4b36501a7dd077574

3 files changed, 11 insertions(+), 2 deletions(-)

jump to
M openbox/config.copenbox/config.c

@@ -37,6 +37,7 @@ gchar *config_title_layout;

gint config_desktops_num; GSList *config_desktops_names; +gint config_screen_firstdesk; gboolean config_redraw_resize;

@@ -247,9 +248,14 @@

node = node->children; if ((n = parse_find_node("number", node))) { - guint d = parse_int(doc, n); + gint d = parse_int(doc, n); if (d > 0) config_desktops_num = d; + } + if ((n = parse_find_node("firstdesk", node))) { + gint d = parse_int(doc, n); + if (d > 0) + config_screen_firstdesk = d; } if ((n = parse_find_node("names", node))) { GSList *it;

@@ -502,6 +508,7 @@

parse_register(i, "theme", parse_theme, NULL); config_desktops_num = 4; + config_screen_firstdesk = 1; config_desktops_names = NULL; parse_register(i, "desktops", parse_desktops, NULL);
M openbox/config.hopenbox/config.h

@@ -74,6 +74,8 @@ extern gchar *config_title_layout;

/*! The number of desktops */ extern gint config_desktops_num; +/*! Desktop to start on, put 5 to start in the center of a 3x3 grid */ +extern gint config_screen_firstdesk; /*! Names for the desktops */ extern GSList *config_desktops_names;
M openbox/screen.copenbox/screen.c

@@ -295,7 +295,7 @@ if (!reconfig)

screen_num_desktops = 0; screen_set_num_desktops(config_desktops_num); if (!reconfig) { - screen_set_desktop(0); + screen_set_desktop(MIN(config_screen_firstdesk, screen_num_desktops) - 1); /* don't start in showing-desktop mode */ screen_showing_desktop = FALSE;