diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2006-08-16 19:32:13 +0000 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2006-08-16 19:32:13 +0000 |
| commit | 83a0303dd75ef0487fdd53e810914f21fdd3e459 (patch) | |
| tree | 537f87dfb49623adb649e8d8a1638dea0a5b2c36 /openbox | |
| parent | 2f4cd02a69b5fb71f011b0cc0a3a054dda1a175f (diff) | |
add option titleNumber in theme section to disable the little [x] that you get after identical window titles
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/client.c | 46 | ||||
| -rw-r--r-- | openbox/config.c | 6 | ||||
| -rw-r--r-- | openbox/config.h | 10 |
3 files changed, 36 insertions, 26 deletions
diff --git a/openbox/client.c b/openbox/client.c index 05a7b891..d107c470 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1550,27 +1550,29 @@ void client_update_title(ObClient *self) if (old_title && 0 != strncmp(old_title, data, strlen(data))) self->title_count = 1; - /* look for duplicates and append a number */ - nums = 0; - for (it = client_list; it; it = g_list_next(it)) - if (it->data != self) { - ObClient *c = it->data; - if (0 == strncmp(c->title, data, strlen(data))) - nums |= 1 << c->title_count; - } - /* find first free number */ - for (i = 1; i <= 32; ++i) - if (!(nums & (1 << i))) { - if (self->title_count == 1 || i == 1) - self->title_count = i; - break; + if (config_title_number) { + /* look for duplicates and append a number */ + nums = 0; + for (it = client_list; it; it = g_list_next(it)) + if (it->data != self) { + ObClient *c = it->data; + if (0 == strncmp(c->title, data, strlen(data))) + nums |= 1 << c->title_count; + } + /* find first free number */ + for (i = 1; i <= 32; ++i) + if (!(nums & (1 << i))) { + if (self->title_count == 1 || i == 1) + self->title_count = i; + break; + } + /* dont display the number for the first window */ + if (self->title_count > 1) { + gchar *ndata; + ndata = g_strdup_printf("%s - [%u]", data, self->title_count); + g_free(data); + data = ndata; } - /* dont display the number for the first window */ - if (self->title_count > 1) { - gchar *ndata; - ndata = g_strdup_printf("%s - [%u]", data, self->title_count); - g_free(data); - data = ndata; } no_number: @@ -1596,7 +1598,9 @@ no_number: 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) { gchar *vdata, *ndata; ndata = g_strdup_printf(" - [%u]", self->title_count); diff --git a/openbox/config.c b/openbox/config.c index bfa5692f..0eb60221 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -39,7 +39,8 @@ gchar *config_theme; gboolean config_theme_keepborder; gboolean config_theme_hidedisabled; -gchar *config_title_layout; +gchar *config_title_layout; +gboolean config_title_number; gint config_desktops_num; GSList *config_desktops_names; @@ -430,6 +431,8 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, g_free(config_title_layout); 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))) config_theme_keepborder = parse_bool(doc, n); if ((n = parse_find_node("hideDisabled", node))) @@ -739,6 +742,7 @@ void config_startup(ObParseInst *i) config_theme = NULL; config_title_layout = g_strdup("NLIMC"); + config_title_number = TRUE; config_theme_keepborder = TRUE; config_theme_hidedisabled = FALSE; diff --git a/openbox/config.h b/openbox/config.h index e68bc12e..67fd8cf7 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -81,15 +81,17 @@ extern guint config_dock_app_move_button; /*! The modifiers to be used with the button to move dock apps */ extern guint config_dock_app_move_modifiers; -/* The name of the theme */ +/*! The name of the theme */ extern gchar *config_theme; -/* Show the onepixel border after toggleDecor */ +/*! Show the one-pixel border after toggleDecor */ 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; -/* Titlebar button layout */ +/*! Titlebar button layout */ extern gchar *config_title_layout; +/*! Append a unique number to windows with same titles */ +extern gboolean config_title_number; /*! The number of desktops */ extern gint config_desktops_num; |
