tscroll virtual windows using mouse scroll - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit 3015b83184ca9d1f6e72800cb1b3df72dd63dd62
parent 623979856321b997ebd32386eb2fbb3302aa33ad
Author: rsc 
Date:   Wed, 29 Dec 2004 02:42:20 +0000

scroll virtual windows using mouse scroll

Diffstat:
  M src/cmd/rio/menu.c                  |      17 +++++++++++++++--

1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/cmd/rio/menu.c b/src/cmd/rio/menu.c
t@@ -118,10 +118,22 @@ button(XButtonEvent *e)
                 } else if(numvirtuals > 1 && (n = menuhit(e, &b2menu)) > -1) 
                                 button2(n);
                 return;
-        default:
-                return;
         case Button3:
                 break;
+        case Button4:
+                /* scroll down changes to next virtual screen */
+                if(!c)
+                        if(numvirtuals > 1 && virt < numvirtuals - 1)
+                                switch_to(virt + 1);
+                return;
+        case Button5:
+                /* scroll up changes to previous virtual screen */
+                if(!c)
+                        if(numvirtuals > 1 && virt > 0)
+                                switch_to(virt - 1);
+                return;
+        default:
+                return;
         }
 
         if (current && current->screen == s)
t@@ -274,6 +286,7 @@ unhide(int n, int map)
                         c->label, (int)c->window);
                 return;
         }
+        c->virt = virt;
 
         if (map) {
                 XMapWindow(dpy, c->window);