After using the CTRL+Wheel patch for the day, I decided wmaker grabbing all CTRL+Button 
events is a bit intrusive, so I am now only grabbing Button4 and Button5. This removes 
the "move windows between workspaces" functionality.

It would be nice to know if some of you agree with me on this.

Regards,

Johann
>From 642f57e47e0e1ebbaec5a48abc104246b4085cb7 Mon Sep 17 00:00:00 2001
From: Johann Haarhoff <[email protected]>
Date: Sun, 14 Mar 2010 22:19:13 +0200
Subject: [PATCH] Make CTRL+Wheel less intrusive

This patch only calls XGrabButton for CTRL+Button4 and CTRL+Button5.
This leaves CTRL+Button1-3 to the application.

This then removes the functionality of moving a window between
workspaces with CTRL+Button1 and CTRL+Button3
---
 src/window.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/window.c b/src/window.c
index ffe43ec..22f97b4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2573,11 +2573,22 @@ void wWindowResetMouseGrabs(WWindow * wwin)
                wHackedGrabButton(AnyButton, MOD_MASK, wwin->client_win,
                                  True, ButtonPressMask | ButtonReleaseMask,
                                  GrabModeSync, GrabModeAsync, None, None);
-        // for CTRL + Wheel to Scroll Horiz, we have to grab CTRL as well
-               wHackedGrabButton(AnyButton, ControlMask, wwin->client_win,
+
+               /* for CTRL+Wheel to Scroll Horiz, we have to grab CTRL as well
+                * but we only grab it for Button4 and Button 5 since a lot of 
apps
+                * use CTRL+Button1-3 for app related functionality
+                */
+               wHackedGrabButton(Button4, ControlMask, wwin->client_win,
+                                 True, ButtonPressMask | ButtonReleaseMask,
+                                 GrabModeSync, GrabModeAsync, None, None);
+               wHackedGrabButton(Button5, ControlMask, wwin->client_win,
+                                 True, ButtonPressMask | ButtonReleaseMask,
+                                 GrabModeSync, GrabModeAsync, None, None);
+
+               wHackedGrabButton(Button4, MOD_MASK | ControlMask, 
wwin->client_win,
                                  True, ButtonPressMask | ButtonReleaseMask,
                                  GrabModeSync, GrabModeAsync, None, None);
-               wHackedGrabButton(AnyButton, MOD_MASK | ControlMask, 
wwin->client_win,
+               wHackedGrabButton(Button5, MOD_MASK | ControlMask, 
wwin->client_win,
                                  True, ButtonPressMask | ButtonReleaseMask,
                                  GrabModeSync, GrabModeAsync, None, None);
        }
@@ -2896,18 +2907,6 @@ static void frameMouseDown(WObjDescriptor *desc, XEvent 
*event)
                wRaiseFrame(wwin->frame->core);
 
        if (event->xbutton.state & ControlMask) {
-               if (event->xbutton.button == Button1) {
-                       if (wwin->screen_ptr->current_workspace > 0) {
-                               
wWindowChangeWorkspace(wwin,wwin->screen_ptr->current_workspace - 1);
-                               wWorkspaceRelativeChange(wwin->screen_ptr,-1);
-                       }
-               }
-               if (event->xbutton.button == Button3) {
-                       if (wwin->screen_ptr->current_workspace < 
(wwin->screen_ptr->workspace_count - 1) ) {
-                               
wWindowChangeWorkspace(wwin,wwin->screen_ptr->current_workspace + 1);
-                               wWorkspaceRelativeChange(wwin->screen_ptr,1);
-                       }
-               }
                if (event->xbutton.button == Button4) {
                        new_width = wwin->client.width - resize_width_increment;
                        wWindowConstrainSize(wwin, &new_width, 
&wwin->client.height);
-- 
1.6.0.3

Reply via email to