diff options
author | Thomas Thurman <tthurman@gnome.org> | 2008-03-21 02:56:52 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2008-03-21 02:56:52 +0000 |
commit | 932fb56ea9c41e0e81c39ac35fcac248d2f510eb (patch) | |
tree | d39a52ffadbc472aac137e088779185bbac43d4d /src/ui | |
parent | 18dfce287379bac9db70b33af26fa22a6047c4e9 (diff) | |
download | metacity-932fb56ea9c41e0e81c39ac35fcac248d2f510eb.tar.gz metacity-932fb56ea9c41e0e81c39ac35fcac248d2f510eb.tar.bz2 |
Workspaces whose name is the standard name plus a non-empty string are
2008-03-21 Thomas Thurman <tthurman@gnome.org>
* src/ui/menu.c (activate_cb, get_workspace_name_with_accel): Workspaces
whose name is the standard name plus a non-empty string are handled
correctly in menus. Closes #453678.
svn path=/trunk/; revision=3657
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/menu.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/menu.c b/src/ui/menu.c index 41f603d..8319897 100644 --- a/src/ui/menu.c +++ b/src/ui/menu.c @@ -177,6 +177,9 @@ activate_cb (GtkWidget *menuitem, gpointer data) * * The calling code owns the string, and is reponsible to free the * memory after use. + * + * See also http://mail.gnome.org/archives/gnome-i18n/2008-March/msg00380.html + * which discusses possible i18n concerns. */ static char* get_workspace_name_with_accel (Display *display, @@ -185,6 +188,7 @@ get_workspace_name_with_accel (Display *display, { const char *name; int number; + int charcount=0; name = meta_core_get_workspace_name_with_index (display, xroot, index); @@ -196,7 +200,8 @@ get_workspace_name_with_accel (Display *display, * return it */ number = 0; - if (sscanf (name, _("Workspace %d"), &number) == 1) + if (sscanf (name, _("Workspace %d%n"), &number, &charcount) != 0 && + *(name + charcount)=='\0') { char *new_name; @@ -241,7 +246,7 @@ get_workspace_name_with_accel (Display *display, *dest++ = *source++; } - /* People don't start at workstation 0, but workstation 1 */ + /* People don't start at workspace 0, but workspace 1 */ if (index < 9) { g_snprintf (dest, 6, " (_%d)", index + 1); |