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)

This commit is contained in:
Mikael Magnusson 2004-02-19 14:33:59 +00:00
parent 3c28739a0e
commit 77af27b8b2
3 changed files with 11 additions and 2 deletions

View file

@ -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,10 +248,15 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
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;
xmlNodePtr nname;
@ -502,6 +508,7 @@ void config_startup(ObParseInst *i)
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);

View file

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

View file

@ -295,7 +295,7 @@ void screen_startup(gboolean 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;