changeset 25:0577e8738dc8

Handle EnterNotify and LeaveNotify in the X backend, so that if a window is activated or deactivated without the mouse moving, state is still updated.
author Jordan Miner <jminer7@gmail.com>
date Sat, 25 Jul 2009 15:03:39 -0500
parents 43a88caead16
children 87265a206638
files dynamin/gui/x_window.d
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dynamin/gui/x_window.d	Sat Jul 25 15:01:46 2009 -0500
+++ b/dynamin/gui/x_window.d	Sat Jul 25 15:03:39 2009 -0500
@@ -355,8 +355,13 @@
 					captor.mouseMoved(args);
 				break;
 			case EnterNotify:
+				auto enterEv = ev.xcrossing;
+				scope args = new MouseEventArgs(enterEv.x+c.borderSize.left,
+					enterEv.y+c.borderSize.top, MouseButton.None);
+				c.mouseMoved(args);
 				break;
 			case LeaveNotify:
+				setHotControl(null);
 				break;
 			case FocusIn:
 				break;