=== modified file 'src/screen.cpp'
--- src/screen.cpp	2014-04-02 21:45:25 +0000
+++ src/screen.cpp	2014-04-09 15:53:23 +0000
@@ -3438,9 +3438,12 @@
 	    if (ignore & ~modHandler->ignoredModMask ())
 		continue;
 
+	    /* Do not allow binding of the scroll wheel for windows other than the desktop
+	     * unless there is a modifier defined */
 	    if (window &&
 		!(window->type () & CompWindowTypeDesktopMask) &&
 		bind.button > 3 &&
+		bind.button < 8 &&
 		!mods)
 		continue;
 

=== modified file 'src/window.cpp'
--- src/window.cpp	2014-04-07 16:18:09 +0000
+++ src/window.cpp	2014-04-09 15:53:23 +0000
@@ -5624,32 +5624,22 @@
 	screen->updatePassiveButtonGrabs(serverFrame);
     else
     {
-	if (priv->type & CompWindowTypeDesktopMask)
-	{
-	    /* Grab all buttons for the desktop window */
-	    XGrabButton (screen->dpy (),
-			 AnyButton,
-			 AnyModifier,
-			 serverFrame, false,
-			 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
-			 GrabModeSync,
-			 GrabModeAsync,
-			 None,
-			 None);
-	}
-	else
-	{
-	    /* Only grab buttons 1-3 */
-	    for (int i = 1; i <= 3; i++)
-		XGrabButton (screen->dpy (),
-			     i,
-			     AnyModifier,
-			     serverFrame, false,
-			     ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
-			     GrabModeSync,
-			     GrabModeAsync,
-			     None,
-			     None);
+	/* Grab all buttons */
+	XGrabButton (screen->dpy (),
+		     AnyButton,
+		     AnyModifier,
+		     serverFrame, false,
+		     ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
+		     GrabModeSync,
+		     GrabModeAsync,
+		     None,
+		     None);
+
+	if (!(priv->type & CompWindowTypeDesktopMask))
+	{
+	    /* Ungrab Buttons 4-7 for scrolling if the window is not the desktop window */
+	    for (int i = 4; i <= 7; i++)
+		XUngrabButton (screen->dpy (), i, AnyModifier, frame);
 	}
     }
 }

