]> Dogcows Code - chaz/openbox/commitdiff
enter/leave actions work!
authorDana Jansens <danakj@orodu.net>
Wed, 4 Dec 2002 08:30:32 +0000 (08:30 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 4 Dec 2002 08:30:32 +0000 (08:30 +0000)
src/actions.cc
src/actions.hh
src/frame.hh

index 6043ad0e6921a2f8ddf086eda167ebd9f25a9d8a..ec70b5b40c7e0acbd10c3765643a9549118640d0 100644 (file)
@@ -13,7 +13,7 @@ namespace ob {
 const unsigned int OBActions::DOUBLECLICKDELAY = 300;
 
 OBActions::OBActions()
-  : _button(0), _enter_win(0)
+  : _button(0)
 {
 
   // XXX: load a configuration out of somewhere
@@ -28,6 +28,8 @@ OBActions::~OBActions()
 
 void OBActions::buttonPressHandler(const XButtonEvent &e)
 {
+  OtkEventHandler::buttonPressHandler(e);
+  
   // XXX: run the PRESS guile hook
   printf("GUILE: PRESS: win %lx modifiers %u button %u time %lx\n",
          (long)e.window, e.state, e.button, e.time);
@@ -40,6 +42,8 @@ void OBActions::buttonPressHandler(const XButtonEvent &e)
 
 void OBActions::buttonReleaseHandler(const XButtonEvent &e)
 {
+  OtkEventHandler::buttonReleaseHandler(e);
+  
   // XXX: run the RELEASE guile hook
   printf("GUILE: RELEASE: win %lx modifiers %u button %u time %lx\n",
          (long)e.window, e.state, e.button, e.time);
@@ -82,24 +86,21 @@ void OBActions::buttonReleaseHandler(const XButtonEvent &e)
 }
 
 
-void OBActions::enter(Window win, unsigned int modifiers)
+void OBActions::enterHandler(const XCrossingEvent &e)
 {
-  _enter_win = win;
-
-  (void)modifiers;
+  OtkEventHandler::enterHandler(e);
+  
   // XXX: run the ENTER guile hook
-  printf("GUILE: ENTER: win %lx modifiers %u\n", (long)win, modifiers);
-
+  printf("GUILE: ENTER: win %lx modifiers %u\n", (long)e.window, e.state);
 }
 
 
-void OBActions::leave(unsigned int modifiers)
+void OBActions::leaveHandler(const XCrossingEvent &e)
 {
-  (void)modifiers;
-  // XXX: run the LEAVE guile hook
-  printf("GUILE: LEAVE: win %lx modifiers %u\n", (long)_enter_win, modifiers);
+  OtkEventHandler::leaveHandler(e);
 
-  _enter_win = 0;
+  // XXX: run the LEAVE guile hook
+  printf("GUILE: LEAVE: win %lx modifiers %u\n", (long)e.window, e.state);
 }
 
 
index 35e8e313445270f6fa8afd4a895ef36eebde3c81..09e76c4e45c8bcbf8d4b6b28f2a792bc55686c2d 100644 (file)
@@ -35,8 +35,6 @@ private:
   MouseButtonAction _release;
   //! The mouse button currently being watched from a press for a CLICK
   unsigned int _button;
-  //! The window the last enter action occured on (where the mouse is located)
-  Window _enter_win;
 
   void insertPress(Window win, unsigned int button, Time time);
   
@@ -47,21 +45,8 @@ public:
   virtual void buttonPressHandler(const XButtonEvent &e);
   virtual void buttonReleaseHandler(const XButtonEvent &e);
   
-
-
-
-  //! Notify that a mouse enter action has occured on a window.
-  /*!
-    @param win The window on which the action was performed.
-    @param modifiers The modifier state for the action.
-  */
-  void enter(Window win, unsigned int modifiers);
-
-  //! Notify that a mouse leave action has occured on a window.
-  /*!
-    @param modifiers The modifier state for the action.
-  */
-  void leave(unsigned int modifiers);
+  virtual void enterHandler(const XCrossingEvent &e);
+  virtual void leaveHandler(const XCrossingEvent &e);
 
   //! Notify that a mouse drag is taking place.
   /*!
index e1647a991e2e7243722d5d2a61617ecb764ef56b..1816ad011ef17f39b30ebe6fc66100dd2977c073 100644 (file)
@@ -30,6 +30,11 @@ namespace ob {
   client are sent to the window manager.
 */
 class OBFrame : public otk::OtkWidget {
+public:
+
+  //! The event mask to grab on frame windows
+  static const long event_mask = EnterWindowMask | LeaveWindowMask;
+
 private:
   OBClient *_client;
   const otk::ScreenInfo *_screen;
This page took 0.026264 seconds and 4 git commands to generate.