[Xfce4-commits] [xfce/xfwm4] 18/18: tabwin: Ensure selected windows remain selected

noreply at xfce.org noreply at xfce.org
Sat Apr 11 17:58:54 CEST 2020


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   4   
   in repository xfce/xfwm4.

commit 0c5c22f0014d246ad97c2864262ed88faecfd976
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed Jan 15 23:21:48 2020 +0100

    tabwin: Ensure selected windows remain selected
    
    Bug: #16382
    
    After hovering the currently selected item the tabwin would be left
    without a selected item. This patch makes sure that on the leave event
    the selected item regains its selected style.
    
    Also switch from GTK_STATE_FLAG_ACTIVE to GTK_STATE_FLAG_CHECKED.
    
    (cherry picked from commit f41e57e1b4086bb1f586c0ee79e3856f092a128b)
---
 src/tabwin.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/tabwin.c b/src/tabwin.c
index a12105c..b059728 100644
--- a/src/tabwin.c
+++ b/src/tabwin.c
@@ -249,16 +249,16 @@ tabwinSetSelected (TabwinWidget *tabwin_widget, GtkWidget *w, GtkWidget *l)
 
     if (tabwin_widget->selected)
     {
-        gtk_widget_unset_state_flags (tabwin_widget->selected, GTK_STATE_FLAG_ACTIVE);
+        gtk_widget_unset_state_flags (tabwin_widget->selected, GTK_STATE_FLAG_CHECKED);
     }
     tabwin_widget->selected = w;
-    gtk_widget_set_state_flags (w, GTK_STATE_FLAG_ACTIVE, FALSE);
+    gtk_widget_set_state_flags (w, GTK_STATE_FLAG_CHECKED, FALSE);
     c = g_object_get_data (G_OBJECT (tabwin_widget->selected), "client-ptr-val");
 
     if (c != NULL)
     {
         TRACE ("client \"%s\" (0x%lx)", c->name, c->window);
-        
+
         /* We don't update labels here */
         if (c->screen_info->params->cycle_tabwin_mode == OVERFLOW_COLUMN_GRID)
         {
@@ -384,9 +384,13 @@ cb_window_button_enter (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 
     g_return_val_if_fail (tabwin_widget != NULL, FALSE);
 
-    /* keep track of which widget we're hovered over */
+    /* keep track of which widget we're hovering over */
     tabwin_widget->hovered = widget;
 
+    /* make sure the hovered style is applied */
+    if (tabwin_widget->hovered == tabwin_widget->selected)
+        gtk_widget_unset_state_flags (tabwin_widget->selected, GTK_STATE_FLAG_CHECKED);
+
     c = g_object_get_data (G_OBJECT (widget), "client-ptr-val");
 
     /* when hovering over a window icon, display it's label but don't
@@ -430,6 +434,7 @@ cb_window_button_leave (GtkWidget *widget, GdkEvent *event, gpointer user_data)
     /* don't do anything if we have the focus */
     if (gtk_widget_is_focus (widget))
     {
+        gtk_widget_set_state_flags (tabwin_widget->selected, GTK_STATE_FLAG_CHECKED, FALSE);
         return FALSE;
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list