print a warning when the session has a different number of desktops than the openbox config
This commit is contained in:
parent
1b33ab6c0d
commit
f476442531
3 changed files with 9 additions and 3 deletions
|
@ -55,7 +55,7 @@ RrFont *config_font_menuitem;
|
||||||
RrFont *config_font_menutitle;
|
RrFont *config_font_menutitle;
|
||||||
RrFont *config_font_osd;
|
RrFont *config_font_osd;
|
||||||
|
|
||||||
gint config_desktops_num;
|
guint config_desktops_num;
|
||||||
GSList *config_desktops_names;
|
GSList *config_desktops_names;
|
||||||
guint config_screen_firstdesk;
|
guint config_screen_firstdesk;
|
||||||
guint config_desktop_popup_time;
|
guint config_desktop_popup_time;
|
||||||
|
@ -605,7 +605,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
if ((n = parse_find_node("number", node))) {
|
if ((n = parse_find_node("number", node))) {
|
||||||
gint d = parse_int(doc, n);
|
gint d = parse_int(doc, n);
|
||||||
if (d > 0)
|
if (d > 0)
|
||||||
config_desktops_num = d;
|
config_desktops_num = (unsigned) d;
|
||||||
}
|
}
|
||||||
if ((n = parse_find_node("firstdesk", node))) {
|
if ((n = parse_find_node("firstdesk", node))) {
|
||||||
gint d = parse_int(doc, n);
|
gint d = parse_int(doc, n);
|
||||||
|
|
|
@ -143,7 +143,7 @@ extern RrFont *config_font_menuitem;
|
||||||
extern RrFont *config_font_osd;
|
extern RrFont *config_font_osd;
|
||||||
|
|
||||||
/*! The number of desktops */
|
/*! The number of desktops */
|
||||||
extern gint config_desktops_num;
|
extern guint config_desktops_num;
|
||||||
/*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
|
/*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
|
||||||
extern guint config_screen_firstdesk;
|
extern guint config_screen_firstdesk;
|
||||||
/*! Names for the desktops */
|
/*! Names for the desktops */
|
||||||
|
|
|
@ -402,7 +402,13 @@ void screen_startup(gboolean reconfig)
|
||||||
screen_num_desktops = 0;
|
screen_num_desktops = 0;
|
||||||
if (PROP_GET32(RootWindow(ob_display, ob_screen),
|
if (PROP_GET32(RootWindow(ob_display, ob_screen),
|
||||||
net_number_of_desktops, cardinal, &d))
|
net_number_of_desktops, cardinal, &d))
|
||||||
|
{
|
||||||
|
if (d != config_desktops_num) {
|
||||||
|
g_warning(_("Openbox is configured for %d desktops, but the current session has %d. Overriding the Openbox configuration."),
|
||||||
|
config_desktops_num, d);
|
||||||
|
}
|
||||||
screen_set_num_desktops(d);
|
screen_set_num_desktops(d);
|
||||||
|
}
|
||||||
/* restore from session if possible */
|
/* restore from session if possible */
|
||||||
else if (session_num_desktops)
|
else if (session_num_desktops)
|
||||||
screen_set_num_desktops(session_num_desktops);
|
screen_set_num_desktops(session_num_desktops);
|
||||||
|
|
Loading…
Reference in a new issue