! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Allow workspace switching anywhere using <super>+mousewheel
Status:
RESOLVED: FIXED
Severity:
enhancement

Comments

Description Hungerburg 2010-05-04 10:48:09 CEST
Created attachment 2962 
Patch to let the mousewheel and <super> switch workspaces anytime

A lot of the time, one hand rests on the mouse, while the other hand rests on the keyboard. I have got used to cycle workspaces with <super><button 4|5> and xfwm4 did not allow me to configure that. Running a fresh install of xubuntu 10.4 it was not all too difficult to get the environment up to build xfwm4 from source and patch it as seen fit:

--- events.c.ubuntu
+++ events.c
@@ -932,6 +932,13 @@
             part = edgeGetPart (c, ev);
             edgeButton (c, part, ev);
         }
+        // dub sez... mouse wheel cycle workspaces with super key
+        else if ((state & SuperMask) && (screen_info->params->scroll_workspaces)
+            && ((ev->button == Button4) || (ev->button == Button5)))
+        {
+            rootScrollButton (display_info, ev);
+        }
+        // ...sez dub
         else if (WIN_IS_BUTTON (win))
         {
             if (ev->button <= Button3)

I fear that from now on I have to do this every time xubuntu updates the package, so I am asking you to make this a configurable option in your future releases. Think of it and you may like it too!

Thank you

-- 
peter
Comment 1 Olivier Fourdan editbugs 2016-06-14 14:54:45 CEST
Patch pushed on git, closing.
Comment 2 Olivier Fourdan editbugs 2016-06-14 14:55:09 CEST
Oh sorry, wrong bug!!
Comment 3 Olivier Fourdan editbugs 2016-06-14 14:57:58 CEST
I cannot take that patch as-is, it's hard coding super as the modifier and conflict directly with the other uses of Super+mousewheel.
Comment 4 haarp 2016-06-14 15:58:17 CEST
(In reply to Olivier Fourdan from comment #3)
> I cannot take that patch as-is, it's hard coding super as the modifier and
> conflict directly with the other uses of Super+mousewheel.

I was also interested in this functionality, I implemented it properly (I think). It uses the "easy" key defined in Xfwm and the mouse backward/forward buttons (8 and 9), to switch workspaces. Most mice have these buttons nowadays.

--- a/src/events.c	2016-06-14 15:08:16.995988539 +0200
+++ b/src/events.c	2016-06-14 15:50:45.999330481 +0200
@@ -944,6 +944,15 @@ handleButtonPress (DisplayInfo *display_
             compositorZoomOut(screen_info, ev);
         }
 #endif /* HAVE_COMPOSITOR */
+        else if ((ev->button == Button8) && (state) && (state == screen_info->params->easy_click))
+        {
+            workspaceSwitch (screen_info, screen_info->current_ws - 1, c, TRUE, ev->time);
+        }
+        else if ((ev->button == Button9) && (state) && (state == screen_info->params->easy_click))
+        {
+            workspaceSwitch (screen_info, screen_info->current_ws + 1, c, TRUE, ev->time);
+        }
+
         else if (WIN_IS_BUTTON (win))
         {
             if (ev->button <= Button3)
--- a/src/misc.h	2016-06-14 15:51:38.762663991 +0200
+++ b/src/misc.h	2016-06-14 15:52:01.115997400 +0200
@@ -46,6 +46,14 @@
 #define Button7 7
 #endif
 
+#ifndef Button8
+#define Button8 8
+#endif
+
+#ifndef Button9
+#define Button9 9
+#endif
+
 unsigned int             getMouseXY                             (ScreenInfo *,
                                                                  Window,
                                                                  int *,
Comment 5 Olivier Fourdan editbugs 2016-06-14 16:04:28 CEST
Yeah, I see no problem with using the additional (unused) buttons for that, if you can cook up a properly formatted git format-patch and attach it here, I would push it.
Comment 6 haarp 2016-06-14 22:05:22 CEST
Created attachment 6704 
Patch to enable workspace switching via easy-move key + mouse8/9

(In reply to Olivier Fourdan from comment #5)
> Yeah, I see no problem with using the additional (unused) buttons for that,
> if you can cook up a properly formatted git format-patch and attach it here,
> I would push it.

Here you go!
Comment 7 Olivier Fourdan editbugs 2016-06-15 08:33:50 CEST
Pushed to master as commit 5effde6 with small changes in the commit message.
Comment 8 haarp 2016-06-15 09:03:38 CEST
(In reply to Olivier Fourdan from comment #7)
> Pushed to master as commit 5effde6 with small changes in the commit message.

Sweet, thanks!

Bug #6427

Reported by:
Hungerburg
Reported on: 2010-05-04
Last modified on: 2016-06-15

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Attachments

Additional information