Temporary workaround for moving dockapp or displaying context menu mouse-workaround
authorHugo Villeneuve <hugo@hugovil.com>
Sat, 25 May 2013 15:52:26 +0000 (11:52 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 6 Nov 2013 01:22:36 +0000 (20:22 -0500)
src/xevents.c

index 3eec774..b949819 100644 (file)
@@ -147,6 +147,25 @@ void ProcessXlibEvents(void)
                        if (Event.xbutton.button == Button1) {
                                /* Mouse LEFT button pressed. */
                                button1_pressed = true;
+                       } else if (Event.xbutton.button == Button2) {
+                               /*
+                                * Temporary workaround for moving dockapp or
+                                * displaying context menu.
+                                * If the user presses on button2, the dockapp
+                                * window will no longer process xevents.
+                                * WindowMaker will then process them so by
+                                * clicking anywhere on the dockapp it will be
+                                * able to move it. Same thing for
+                                * right-clicking anywhere on the dockapp.
+                                * After that, dockapp needs to be restarted
+                                * for normal mouse behavior.
+                                */
+                               printf("Return mouse control to WindowMaker\n");
+
+                               (void) XSelectInput(dockapp.display,
+                                                   dockapp.iconwin,
+                                                   ExposureMask |
+                                                   StructureNotifyMask);
                        }
                        break;
                case ButtonRelease: