]> Dogcows Code - chaz/openbox/commitdiff
add a Release MouseAction for python hooks
authorDana Jansens <danakj@orodu.net>
Thu, 30 Jan 2003 16:54:30 +0000 (16:54 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 30 Jan 2003 16:54:30 +0000 (16:54 +0000)
src/actions.cc
src/python.hh

index 6059f00d830a3e51df13ca8d86be03dab04b371a..f77acc2fb79c194c855f7c4eb4a62fb03ea65062 100644 (file)
@@ -117,6 +117,20 @@ void Actions::buttonReleaseHandler(const XButtonEvent &e)
     (openbox->findHandler(e.window));
   if (!w) return;
 
+  // run the RELEASE python hook
+  // kill off the Button1Mask etc, only want the modifiers
+  unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
+                                  Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
+  int screen;
+  Client *c = openbox->findClient(e.window);
+  if (c)
+    screen = c->screen();
+  else
+    screen = otk::display->findScreen(e.root)->screen();
+  MouseData data(screen, c, e.time, state, e.button, w->mcontext(),
+                 MouseAction::Release);
+  openbox->bindings()->fireButton(&data);
+
   // not for the button we're watching?
   if (_button != e.button) return;
 
@@ -133,17 +147,7 @@ void Actions::buttonReleaseHandler(const XButtonEvent &e)
     return;
 
   // run the CLICK python hook
-  // kill off the Button1Mask etc, only want the modifiers
-  unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
-                                  Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
-  int screen;
-  Client *c = openbox->findClient(e.window);
-  if (c)
-    screen = c->screen();
-  else
-    screen = otk::display->findScreen(e.root)->screen();
-  MouseData data(screen, c, e.time, state, e.button, w->mcontext(),
-                 MouseAction::Click);
+  data.action = MouseAction::Click;
   openbox->bindings()->fireButton(&data);
     
 
index 42b9726f50081ca752721f8fab64545bb42b3c69..90df3e10c34118e1b2a4c44db9f61cbcedaa47e8 100644 (file)
@@ -46,6 +46,7 @@ struct MouseContext {
 struct MouseAction {
   enum MA {
     Press,
+    Release,
     Click,
     DoubleClick,
     Motion
This page took 0.026298 seconds and 4 git commands to generate.