From 46ededed08b0b9c516db58bf44a9698bff8da643 Mon Sep 17 00:00:00 2001 From: Vincent Noel Date: Thu, 20 Jan 2005 16:41:29 +0000 Subject: [PATCH] Show labels in bold for windows that demand attention. Fixes #164590. 2005-01-20 Vincent Noel * src/screen.c: (meta_screen_ensure_tab_popup), (meta_screen_ensure_workspace_popup): * src/tabpopup.c: (meta_ui_tab_popup_new), (display_entry): * src/tabpopup.h: Show labels in bold for windows that demand attention. Fixes #164590. --- ChangeLog | 8 ++++++++ src/screen.c | 5 +++-- src/tabpopup.c | 23 +++++++++++++++++------ src/tabpopup.h | 1 + 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d025c547..abbeb4902 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-01-20 Vincent Noel + + * src/screen.c: (meta_screen_ensure_tab_popup), + (meta_screen_ensure_workspace_popup): + * src/tabpopup.c: (meta_ui_tab_popup_new), (display_entry): + * src/tabpopup.h: Show labels in bold for windows that demand + attention. Fixes #164590. + 2005-01-18 Vincent Noel * src/screen.c: (meta_screen_ensure_tab_popup), diff --git a/src/screen.c b/src/screen.c index 3ee1f997a..793c81534 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1164,6 +1164,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen, entries[i].icon = window->icon; entries[i].blank = FALSE; entries[i].minimized = window->minimized; + entries[i].demands_attention = window->wm_state_demands_attention; if (!window->minimized || !meta_window_get_icon_geometry (window, &r)) meta_window_get_outer_rect (window, &r); @@ -1256,7 +1257,6 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen) entries[i].title = meta_workspace_get_name (workspace); entries[i].icon = NULL; entries[i].blank = FALSE; - entries[i].minimized = FALSE; g_assert (entries[i].title != NULL); } @@ -1266,8 +1266,9 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen) entries[i].title = NULL; entries[i].icon = NULL; entries[i].blank = TRUE; - entries[i].minimized = FALSE; } + entries[i].minimized = FALSE; + entries[i].demands_attention = FALSE; ++i; } diff --git a/src/tabpopup.c b/src/tabpopup.c index a0fde7e50..da3a3a184 100644 --- a/src/tabpopup.c +++ b/src/tabpopup.c @@ -221,17 +221,28 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, te->title = NULL; if (entries[i].title) { + gchar *tmp; if (entries[i].minimized) { - gchar *tmp; tmp = g_strdup_printf ("[%s]", entries[i].title); - te->title = utf8_strndup (tmp, max_chars_per_title); - g_free (tmp); } else { - te->title = utf8_strndup (entries[i].title, max_chars_per_title); + tmp = g_strdup (entries[i].title); } + + if (entries[i].demands_attention) + { + gchar *escaped, *markup; + escaped = g_markup_escape_text (tmp, -1); + markup = g_strdup_printf ("%s", escaped); + g_free (escaped); + g_free (tmp); + tmp = markup; + } + + te->title = utf8_strndup (tmp, max_chars_per_title); + g_free (tmp); } te->widget = NULL; te->icon = entries[i].icon; @@ -347,7 +358,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, 0, 0); /* Efficiency rules! */ - gtk_label_set_text (GTK_LABEL (popup->label), + gtk_label_set_markup (GTK_LABEL (popup->label), te->title); gtk_widget_size_request (popup->label, &req); max_label_width = MAX (max_label_width, req.width); @@ -441,7 +452,7 @@ display_entry (MetaTabPopup *popup, unselect_workspace (popup->current_selected_entry->widget); } - gtk_label_set_text (GTK_LABEL (popup->label), te->title); + gtk_label_set_markup (GTK_LABEL (popup->label), te->title); if (popup->outline) select_image (te->widget); diff --git a/src/tabpopup.h b/src/tabpopup.h index fe6a3ed3a..c220003c3 100644 --- a/src/tabpopup.h +++ b/src/tabpopup.h @@ -41,6 +41,7 @@ struct _MetaTabEntry int inner_x, inner_y, inner_width, inner_height; guint blank : 1; guint minimized : 1; + guint demands_attention : 1; }; MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries,