Author: rolf
Date: 2007-08-27 05:02:04 -0400 (Mon, 27 Aug 2007)
New Revision: 84867

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/panel.cpp
   trunk/moon/src/runtime.h
Log:
* panel.cpp: Panel::HandleMotion, if we're the captured element, handle
  the motion event even though the mouse isn't over us.
* runtime.h: Add a public Surface::GetCapturedElement.

Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-08-27 08:31:26 UTC (rev 84866)
+++ trunk/moon/src/ChangeLog    2007-08-27 09:02:04 UTC (rev 84867)
@@ -1,3 +1,9 @@
+2007-08-27  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * panel.cpp: Panel::HandleMotion, if we're the captured element, handle 
the
+         motion event even though the mouse isn't over us.
+       * runtime.h: Add a public Surface::GetCapturedElement.
+
 2007-08-24  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
        * mplayer.cpp (StopThreads): Need to reset current_pts to 0 so the

Modified: trunk/moon/src/panel.cpp
===================================================================
--- trunk/moon/src/panel.cpp    2007-08-27 08:31:26 UTC (rev 84866)
+++ trunk/moon/src/panel.cpp    2007-08-27 09:02:04 UTC (rev 84867)
@@ -15,6 +15,7 @@
 #include "panel.h"
 #include "brush.h"
 #include "collection.h"
+#include "runtime.h"
 
 VisualCollection *
 Panel::GetChildren ()
@@ -358,8 +359,18 @@
 void
 Panel::HandleMotion (cairo_t *cr, int state, double x, double y, MouseCursor 
*cursor)
 {
-       UIElement *new_over = FindMouseOver (cr, x, y);
+       Surface *s = GetSurface ();
+       UIElement *new_over;
+       bool captured = false;
 
+       if (s != NULL && s->GetCapturedElement () == this) {
+               captured = true;
+               new_over = this;
+       } else {
+               new_over = FindMouseOver (cr, x, y);
+       }
+
+
        if (new_over != mouse_over) {
                if (mouse_over)
                        mouse_over->Leave ();
@@ -376,7 +387,7 @@
        if (mouse_over)
                mouse_over->HandleMotion (cr, state, x, y, cursor);
 
-       if (mouse_over || InsideObject (cr, x, y))
+       if (mouse_over || captured || InsideObject (cr, x, y))
                FrameworkElement::HandleMotion (cr, state, x, y, NULL);
 }
 

Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h    2007-08-27 08:31:26 UTC (rev 84866)
+++ trunk/moon/src/runtime.h    2007-08-27 09:02:04 UTC (rev 84867)
@@ -68,6 +68,8 @@
        GtkWidget* GetDrawingArea () { return drawing_area; }
        UIElement* GetToplevel() { return toplevel; }
 
+       UIElement* GetCapturedElement () { return capture_element; }
+
        int ResizeEvent;
 
 private:

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to