add option titleNumber in theme section to disable the little [x] that you get after identical window titles
This commit is contained in:
parent
2f4cd02a69
commit
83a0303dd7
5 changed files with 40 additions and 28 deletions
|
@ -29,7 +29,8 @@
|
||||||
|
|
||||||
<theme>
|
<theme>
|
||||||
<name>TheBear</name>
|
<name>TheBear</name>
|
||||||
<titlelayout>NLIMC</titlelayout>
|
<titleLayout>NLIMC</titlelayout>
|
||||||
|
<titleNumber>yes</titlenumber>
|
||||||
<!--
|
<!--
|
||||||
avaible characters are NDSLIMC, each can occur at most once.
|
avaible characters are NDSLIMC, each can occur at most once.
|
||||||
N: client menu
|
N: client menu
|
||||||
|
|
|
@ -103,7 +103,8 @@
|
||||||
<xs:complexType name="theme">
|
<xs:complexType name="theme">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element minOccurs="0" name="name" type="xs:string"/>
|
<xs:element minOccurs="0" name="name" type="xs:string"/>
|
||||||
<xs:element minOccurs="0" name="titlelayout" type="xs:string"/>
|
<xs:element minOccurs="0" name="titleLayout" type="xs:string"/>
|
||||||
|
<xs:element minOccurs="0" name="titleNumber" type="ob:bool"/>
|
||||||
<xs:element minOccurs="0" name="keepBorder" type="ob:bool"/>
|
<xs:element minOccurs="0" name="keepBorder" type="ob:bool"/>
|
||||||
<xs:element minOccurs="0" name="hideDisabled" type="ob:bool"/>
|
<xs:element minOccurs="0" name="hideDisabled" type="ob:bool"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
|
@ -1550,6 +1550,7 @@ void client_update_title(ObClient *self)
|
||||||
if (old_title && 0 != strncmp(old_title, data, strlen(data)))
|
if (old_title && 0 != strncmp(old_title, data, strlen(data)))
|
||||||
self->title_count = 1;
|
self->title_count = 1;
|
||||||
|
|
||||||
|
if (config_title_number) {
|
||||||
/* look for duplicates and append a number */
|
/* look for duplicates and append a number */
|
||||||
nums = 0;
|
nums = 0;
|
||||||
for (it = client_list; it; it = g_list_next(it))
|
for (it = client_list; it; it = g_list_next(it))
|
||||||
|
@ -1572,6 +1573,7 @@ void client_update_title(ObClient *self)
|
||||||
g_free(data);
|
g_free(data);
|
||||||
data = ndata;
|
data = ndata;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
no_number:
|
no_number:
|
||||||
PROP_SETS(self->window, net_wm_visible_name, data);
|
PROP_SETS(self->window, net_wm_visible_name, data);
|
||||||
|
@ -1596,7 +1598,9 @@ no_number:
|
||||||
read_title = FALSE;
|
read_title = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* append the title count, dont display the number for the first window */
|
/* append the title count, dont display the number for the first window.
|
||||||
|
* We don't need to check for config_title_number here since title_count
|
||||||
|
* is not set above 1 then. */
|
||||||
if (read_title && self->title_count > 1) {
|
if (read_title && self->title_count > 1) {
|
||||||
gchar *vdata, *ndata;
|
gchar *vdata, *ndata;
|
||||||
ndata = g_strdup_printf(" - [%u]", self->title_count);
|
ndata = g_strdup_printf(" - [%u]", self->title_count);
|
||||||
|
|
|
@ -40,6 +40,7 @@ gboolean config_theme_keepborder;
|
||||||
gboolean config_theme_hidedisabled;
|
gboolean config_theme_hidedisabled;
|
||||||
|
|
||||||
gchar *config_title_layout;
|
gchar *config_title_layout;
|
||||||
|
gboolean config_title_number;
|
||||||
|
|
||||||
gint config_desktops_num;
|
gint config_desktops_num;
|
||||||
GSList *config_desktops_names;
|
GSList *config_desktops_names;
|
||||||
|
@ -430,6 +431,8 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
g_free(config_title_layout);
|
g_free(config_title_layout);
|
||||||
config_title_layout = parse_string(doc, n);
|
config_title_layout = parse_string(doc, n);
|
||||||
}
|
}
|
||||||
|
if ((n = parse_find_node("titleNumber", node)))
|
||||||
|
config_theme_hidedisabled = parse_bool(doc, n);
|
||||||
if ((n = parse_find_node("keepBorder", node)))
|
if ((n = parse_find_node("keepBorder", node)))
|
||||||
config_theme_keepborder = parse_bool(doc, n);
|
config_theme_keepborder = parse_bool(doc, n);
|
||||||
if ((n = parse_find_node("hideDisabled", node)))
|
if ((n = parse_find_node("hideDisabled", node)))
|
||||||
|
@ -739,6 +742,7 @@ void config_startup(ObParseInst *i)
|
||||||
config_theme = NULL;
|
config_theme = NULL;
|
||||||
|
|
||||||
config_title_layout = g_strdup("NLIMC");
|
config_title_layout = g_strdup("NLIMC");
|
||||||
|
config_title_number = TRUE;
|
||||||
config_theme_keepborder = TRUE;
|
config_theme_keepborder = TRUE;
|
||||||
config_theme_hidedisabled = FALSE;
|
config_theme_hidedisabled = FALSE;
|
||||||
|
|
||||||
|
|
|
@ -81,15 +81,17 @@ extern guint config_dock_app_move_button;
|
||||||
/*! The modifiers to be used with the button to move dock apps */
|
/*! The modifiers to be used with the button to move dock apps */
|
||||||
extern guint config_dock_app_move_modifiers;
|
extern guint config_dock_app_move_modifiers;
|
||||||
|
|
||||||
/* The name of the theme */
|
/*! The name of the theme */
|
||||||
extern gchar *config_theme;
|
extern gchar *config_theme;
|
||||||
|
|
||||||
/* Show the onepixel border after toggleDecor */
|
/*! Show the one-pixel border after toggleDecor */
|
||||||
extern gboolean config_theme_keepborder;
|
extern gboolean config_theme_keepborder;
|
||||||
/* Hide window frame buttons that the window doesn't allow */
|
/*! Hide window frame buttons that the window doesn't allow */
|
||||||
extern gboolean config_theme_hidedisabled;
|
extern gboolean config_theme_hidedisabled;
|
||||||
/* Titlebar button layout */
|
/*! Titlebar button layout */
|
||||||
extern gchar *config_title_layout;
|
extern gchar *config_title_layout;
|
||||||
|
/*! Append a unique number to windows with same titles */
|
||||||
|
extern gboolean config_title_number;
|
||||||
|
|
||||||
/*! The number of desktops */
|
/*! The number of desktops */
|
||||||
extern gint config_desktops_num;
|
extern gint config_desktops_num;
|
||||||
|
|
Loading…
Reference in a new issue