[Xfce4-commits] <xfwm4:ochosi/tabwin> Allow cycle through windows with mouse wheel

Simon Steinbeiss noreply at xfce.org
Mon Dec 9 19:40:02 CET 2013


Updating branch refs/heads/ochosi/tabwin
         to 847306de342e94866670663795722760124aad26 (commit)
       from cad561ca3a5f20aef750296be4d4d93b3c5a8fa3 (commit)

commit 847306de342e94866670663795722760124aad26
Author: Cédric Leporcq <cedl38 at gmail.com>
Date:   Thu Dec 5 00:23:07 2013 +0100

    Allow cycle through windows with mouse wheel
    
    Signed-off-by: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>

 src/cycle.c |   49 ++++++++++++++++++++++++++++++++++---------------
 1 file changed, 34 insertions(+), 15 deletions(-)

diff --git a/src/cycle.c b/src/cycle.c
index 6051d61..77bf9c7 100644
--- a/src/cycle.c
+++ b/src/cycle.c
@@ -330,21 +330,6 @@ clientCycleEventFilter (XEvent * xevent, gpointer data)
                         cycling = FALSE;
                     }
                 }
-
-                if (cycling)
-                {
-                    if (c)
-                    {
-                        if (passdata->wireframe)
-                        {
-                            wireframeUpdate (c, passdata->wireframe);
-                        }
-                    }
-                    else
-                    {
-                        cycling = FALSE;
-                    }
-                }
             }
             break;
         case KeyRelease:
@@ -378,8 +363,24 @@ clientCycleEventFilter (XEvent * xevent, gpointer data)
                             c = tabwinSelectHoveredWidget (passdata->tabwin);
                             break;
                         }
+                        else if  (ev.button == Button4)
+                        {
+                            /* Mouse wheel scroll up */
+                            TRACE ("Cycle: previous");
+                            c2 = tabwinSelectPrev(passdata->tabwin);
+                        }
+                        else if (ev.button == Button5)
+                        {
+                            /* Mouse wheel scroll down */
+                            TRACE ("Cycle: next");
+                            c2 = tabwinSelectNext(passdata->tabwin);
+                        }
                     }
                 }
+                if (c2)
+                {
+                    c = c2;
+                }
             }
             break;
         default:
@@ -393,6 +394,24 @@ clientCycleEventFilter (XEvent * xevent, gpointer data)
         gtk_main_quit ();
     }
 
+    if (status == EVENT_FILTER_STOP)
+    {
+        if (cycling)
+        {
+            if (c)
+            {
+                if (passdata->wireframe)
+                {
+                    wireframeUpdate (c, passdata->wireframe);
+                }
+            }
+            else
+            {
+                cycling = FALSE;
+            }
+        }
+    }
+
     return status;
 }
 


More information about the Xfce4-commits mailing list