--- plugins/tasklist/tasklist-widget.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) Index: xfce4-panel-4.10.0/plugins/tasklist/tasklist-widget.c =================================================================== --- xfce4-panel-4.10.0.orig/plugins/tasklist/tasklist-widget.c +++ xfce4-panel-4.10.0/plugins/tasklist/tasklist-widget.c @@ -310,7 +310,8 @@ static void xfce_tasklist_ /* tasklist buttons */ static inline gboolean xfce_tasklist_button_visible (XfceTasklistChild *child, - WnckWorkspace *active_ws); + WnckWorkspace *active_ws, + gboolean allow_attention); static gint xfce_tasklist_button_compare (gconstpointer child_a, gconstpointer child_b, gpointer user_data); @@ -1565,7 +1566,7 @@ xfce_tasklist_active_workspace_changed ( if (child->type != CHILD_TYPE_GROUP) { - if (xfce_tasklist_button_visible (child, active_ws)) + if (xfce_tasklist_button_visible (child, active_ws, TRUE /* allow_attention */)) gtk_widget_show (child->button); else gtk_widget_hide (child->button); @@ -1604,7 +1605,7 @@ xfce_tasklist_window_added (WnckScreen child = xfce_tasklist_button_new (window, tasklist); /* initial visibility of the function */ - if (xfce_tasklist_button_visible (child, wnck_screen_get_active_workspace (screen))) + if (xfce_tasklist_button_visible (child, wnck_screen_get_active_workspace (screen), TRUE /* allow_attention */)) gtk_widget_show (child->button); if (G_LIKELY (child->class_group != NULL)) @@ -2196,7 +2197,8 @@ xfce_tasklist_wireframe_update (XfceTask **/ static inline gboolean xfce_tasklist_button_visible (XfceTasklistChild *child, - WnckWorkspace *active_ws) + WnckWorkspace *active_ws, + gboolean allow_attention) { XfceTasklist *tasklist = XFCE_TASKLIST (child->tasklist); gint x, y, w, h; @@ -2217,6 +2219,8 @@ xfce_tasklist_button_visible (XfceTaskli } if (tasklist->all_workspaces + || (active_ws != NULL && allow_attention && + wnck_window_or_transient_needs_attention (child->window)) || (active_ws != NULL && (G_UNLIKELY (wnck_workspace_is_virtual (active_ws)) ? wnck_window_is_in_viewport (child->window, active_ws) @@ -2491,10 +2495,34 @@ xfce_tasklist_button_state_changed (Wnck || PANEL_HAS_FLAG (changed_state, WNCK_WINDOW_STATE_URGENT)) { /* only start blinking if the window requesting urgentcy - * notification is not the active window */ + * notification is not already blinking */ blink = wnck_window_or_transient_needs_attention (window); - if (!blink || (blink && !wnck_window_is_active (window))) - xfce_arrow_button_set_blinking (XFCE_ARROW_BUTTON (child->button), blink); + if (!blink || (blink && !xfce_arrow_button_get_blinking (XFCE_ARROW_BUTTON (child->button)))) + { + /* show/hide button (from other workspace/viewport) */ + tasklist = XFCE_TASKLIST (child->tasklist); + screen = tasklist->screen; + if (!tasklist->all_workspaces) + { + /* active window must deactivate first otherwise won't flash */ + if (blink && !xfce_tasklist_button_visible (child, wnck_screen_get_active_workspace (screen), FALSE /* allow_attention */)) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (child->button), FALSE); + xfce_tasklist_active_workspace_changed (screen, NULL, tasklist); + } + + /* toggle label bold */ + if (tasklist->show_labels) + { + PangoFontDescription *font_desc; + + font_desc = pango_font_description_new (); + pango_font_description_set_weight (font_desc, blink ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL); + gtk_widget_modify_font (child->label, font_desc); + pango_font_description_free (font_desc); + } + + xfce_arrow_button_set_blinking (XFCE_ARROW_BUTTON (child->button), blink); + } } } @@ -2534,7 +2562,7 @@ xfce_tasklist_button_geometry_changed2 ( { /* check if we need to change the visibility of the button */ active_ws = wnck_screen_get_active_workspace (child->tasklist->screen); - if (xfce_tasklist_button_visible (child, active_ws)) + if (xfce_tasklist_button_visible (child, active_ws, TRUE /* allow_attention */)) gtk_widget_show (child->button); else gtk_widget_hide (child->button);