summaryrefslogtreecommitdiff
path: root/plugingui/eventhandler.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-30 22:02:20 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-30 22:02:20 +0100
commitbe675587812c27fac9838af844f8ecb44703ff08 (patch)
tree88a5436c5f584991e54bf0d7644d651cc4c67a54 /plugingui/eventhandler.cc
parent9f49f84a82073a64e2d8415c60a5b77d724d80dd (diff)
Implemented new mouseLeave/Enter Events. Use for buttons.
Diffstat (limited to 'plugingui/eventhandler.cc')
-rw-r--r--plugingui/eventhandler.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc
index 1cf67fc..050c2e1 100644
--- a/plugingui/eventhandler.cc
+++ b/plugingui/eventhandler.cc
@@ -447,6 +447,15 @@ void GUI::EventHandler::processEvents(Window *window)
MouseMoveEvent *me = (MouseMoveEvent*)event;
Widget *w = window->find(me->x, me->y);
+ Widget *oldw = window->mouseFocus();
+ if(w != oldw) {
+ // Send focus leave to oldw
+ if(oldw) oldw->mouseLeaveEvent();
+ // Send focus enter to w
+ if(w) w->mouseEnterEvent();
+
+ window->setMouseFocus(w);
+ }
if(window->buttonDownFocus()) {
Widget *w = window->buttonDownFocus();