[Xfce4-commits] <xfwm4:ochosi/tabwin> Improve keyboard navigation in the tabwin

Simon Steinbeiss noreply at xfce.org
Sat Nov 30 22:08:01 CET 2013


Updating branch refs/heads/ochosi/tabwin
         to 465cc5b73af615fe7a3ba7067637b7f32bb0fb6d (commit)
       from 3838e97f85af98b5daebdb55a3a0879624d9a2ef (commit)

commit 465cc5b73af615fe7a3ba7067637b7f32bb0fb6d
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Wed Nov 27 17:25:10 2013 +0300

    Improve keyboard navigation in the tabwin
    
    When cycling applications have the keyboard wrap around when it
    reaches the end of a row or column.
    
    Signed-off-by: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>

 src/tabwin.c |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/src/tabwin.c b/src/tabwin.c
index 35e96b8..72f79d2 100644
--- a/src/tabwin.c
+++ b/src/tabwin.c
@@ -787,10 +787,20 @@ tabwinSelectDelta (Tabwin *t, int row_delta, int col_delta)
     if (col_current < 0)
     {
         col_current = cols - 1;
+        row_current--;
+        if (row_current < 0)
+        {
+            row_current = rows - 1;
+        }
     }
     else if (col_current >= cols)
     {
         col_current = 0;
+        row_current++;
+        if (row_current >= rows)
+        {
+            row_current = rows - 1;
+        }
     }
 
     /* Wrap row */
@@ -798,10 +808,29 @@ tabwinSelectDelta (Tabwin *t, int row_delta, int col_delta)
     if (row_current < 0)
     {
         row_current = rows - 1;
+        col_current--;
+        if (col_current < 0)
+        {
+            col_current = cols - 1;
+        }
     }
     else if (row_current >= rows)
     {
         row_current = 0;
+        col_current++;
+        if (col_current >= cols)
+        {
+            if (rows != 1)
+            {
+                col_current = cols - 1;
+            }
+            else
+            {
+                /* If there's only 1 row then col needs to wrap back to
+                 * the head of the grid */
+                col_current = 0;
+            }
+        }
     }
 
     /* So here we are at the new (wrapped) position in the rectangle */
@@ -812,7 +841,10 @@ tabwinSelectDelta (Tabwin *t, int row_delta, int col_delta)
         {
             if (col_delta > 0)
             {
+                /* In this case we're going past the tail, reset to the head
+                 * of the grid */
                 col_current = 0;
+                row_current = 0;
             }
             else
             {
@@ -824,6 +856,11 @@ tabwinSelectDelta (Tabwin *t, int row_delta, int col_delta)
             if (row_delta > 0)
             {
                 row_current = 0;
+                col_current++;
+                if (col_current >= cols)
+                {
+                    col_current = 0;
+                }
             }
             else
             {


More information about the Xfce4-commits mailing list