Mod1MiddleMouse

From Fluxbox-wiki

Jump to: navigation, search

In ChangeLog

*05/09/04:
   * Added Feature Request #1084510 (Mathias)
     When Mod1 + LeftMouse are clicked on a Window and the mouse is not
     moved, the window is raised at LeftMouseRelease
     src/Window.cc

This feature works OK. In addition to this there is also desire to lower window the same way.

In analogy to press Left/Middle button on window title bar the following patch makes Mod1 + MiddleMouse to lower window at MiddleMouseRelease


Note: this is a bit broken (mod1+buttonpress on titlebar does now work). fix will follow shortly

Update on above: it is interesting that button1-doubleclick and button2-release works on titlebar whether mod1 is pressed or not. But button1-press (raise) when alt1 is pressed. [4098] might have fixed that as a side effect. I could implement this patch as it was done, but this one looks less like a hack (in some standpoint, at least)

--- src/Window.cc       (revision 4298)
+++ src/Window.cc       (working copy)
@@ -2687,10 +2687,6 @@
 
 void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
 
-    if ((re.button == 1) && (re.state & Mod1Mask) && !screen().clickRaises())
-        if (!isMoving())
-            raise();
-
     if (isMoving())
         stopMoving();
     else if (isResizing())
@@ -2698,6 +2694,11 @@
     else if (m_attaching_tab)
         attachTo(re.x_root, re.y_root);
     else if (re.window == frame().window()) {
+        if (!screen().clickRaises() && (re.state & Mod1Mask))
+           switch (re.button) {
+               case 1: raise(); break;
+               case 2: lower(); break;
+           }
         if (re.button == 2 && re.state == Mod1Mask)
             ungrabPointer(CurrentTime);
         else
Personal tools
Google Ads