From 3015b83184ca9d1f6e72800cb1b3df72dd63dd62 Mon Sep 17 00:00:00 2001 From: rsc Date: Wed, 29 Dec 2004 02:42:20 +0000 Subject: scroll virtual windows using mouse scroll --- src/cmd/rio/menu.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/cmd/rio') diff --git a/src/cmd/rio/menu.c b/src/cmd/rio/menu.c index d313f5e4..048a2cc4 100644 --- a/src/cmd/rio/menu.c +++ b/src/cmd/rio/menu.c @@ -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) @@ -274,6 +286,7 @@ unhide(int n, int map) c->label, (int)c->window); return; } + c->virt = virt; if (map) { XMapWindow(dpy, c->window); -- cgit v1.2.3