]> Dogcows Code - chaz/openbox/blobdiff - src/actions.cc
fix \'s
[chaz/openbox] / src / actions.cc
index 14fba7db125cd17232708634f69ba2d2ac635490..15a3e6c2667f0b9c88cd5a700f3d6fd9619c9709 100644 (file)
@@ -5,7 +5,7 @@
 #endif
 
 #include "actions.hh"
-#include "widget.hh"
+#include "widgetbase.hh"
 #include "openbox.hh"
 #include "client.hh"
 #include "screen.hh"
@@ -81,13 +81,24 @@ void OBActions::buttonPressHandler(const XButtonEvent &e)
     screen = c->screen();
   else
     screen = otk::OBDisplay::findScreen(e.root)->screen();
-  ButtonData data(screen, c, e.time, state, e.button, w->mcontext(),
-                  MousePress);
+  MouseData data(screen, c, e.time, state, e.button, w->mcontext(),
+                 MousePress);
   Openbox::instance->bindings()->fireButton(&data);
     
   if (_button) return; // won't count toward CLICK events
 
   _button = e.button;
+
+  if (w->mcontext() == MC_Window) {
+    /*
+      Because of how events are grabbed on the client window, we can't get
+      ButtonRelease events, so instead we simply manufacture them here, so that
+      clicks/doubleclicks etc still work.
+    */
+    //XButtonEvent ev = e;
+    //ev.type = ButtonRelease;
+    buttonReleaseHandler(e);
+  }
 }
   
 
@@ -124,8 +135,8 @@ void OBActions::buttonReleaseHandler(const XButtonEvent &e)
     screen = c->screen();
   else
     screen = otk::OBDisplay::findScreen(e.root)->screen();
-  ButtonData data(screen, c, e.time, state, e.button, w->mcontext(),
-                  MouseClick);
+  MouseData data(screen, c, e.time, state, e.button, w->mcontext(),
+                 MouseClick);
   Openbox::instance->bindings()->fireButton(&data);
     
 
@@ -234,9 +245,9 @@ void OBActions::motionHandler(const XMotionEvent &e)
     screen = c->screen();
   else
     screen = otk::OBDisplay::findScreen(e.root)->screen();
-  MotionData data(screen, c, e.time, state, button, w->mcontext(), MouseMotion,
-                  x_root, y_root, _posqueue[0]->pos, _posqueue[0]->clientarea);
-  Openbox::instance->bindings()->fireButton((ButtonData*)&data);
+  MouseData data(screen, c, e.time, state, button, w->mcontext(), MouseMotion,
+                 x_root, y_root, _posqueue[0]->pos, _posqueue[0]->clientarea);
+  Openbox::instance->bindings()->fireButton(&data);
 }
 
 void OBActions::mapRequestHandler(const XMapRequestEvent &e)
This page took 0.024457 seconds and 4 git commands to generate.