Author: miguel
Date: 2007-06-25 19:11:36 -0400 (Mon, 25 Jun 2007)
New Revision: 80739

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/runtime.cpp
Log:
2007-06-25  Miguel de Icaza  <[EMAIL PROTECTED]>

        * runtime.cpp: Cope with the fact that we are now windowless and
        we will be sharing the parent's window.   Fixes mouse events.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-25 22:52:48 UTC (rev 80738)
+++ trunk/moon/src/ChangeLog    2007-06-25 23:11:36 UTC (rev 80739)
@@ -1,5 +1,8 @@
 2007-06-25  Miguel de Icaza  <[EMAIL PROTECTED]>
 
+       * runtime.cpp: Cope with the fact that we are now windowless and
+       we will be sharing the parent's window.   Fixes mouse events.
+
        * collection.cpp (collection_get_value_at, collection_count): Add
        new methods.
 

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-06-25 22:52:48 UTC (rev 80738)
+++ trunk/moon/src/runtime.cpp  2007-06-25 23:11:36 UTC (rev 80739)
@@ -1064,8 +1064,8 @@
        if (event->is_hint) {
                gdk_window_get_pointer (event->window, &x, &y, &state);
        } else {
-               x = (int)event->x;
-               y = (int)event->y;
+               x = (int)event->x + widget->allocation.x;
+               y = (int)event->y + widget->allocation.y;
                state = (GdkModifierType)event->state;
        }
        s->toplevel->handle_motion (s, state, x, y);
@@ -1081,8 +1081,11 @@
                return FALSE;
 
        if (event->type == GDK_ENTER_NOTIFY){
-               s->toplevel->handle_motion (s, event->state, event->x, 
event->y);
-               s->toplevel->enter (s, event->state, event->x, event->y);
+               int x = event->x + widget->allocation.x;
+               int y = event->y + widget->allocation.y;
+
+               s->toplevel->handle_motion (s, event->state, x, y);
+               s->toplevel->enter (s, event->state, x, y);
        } else {
                s->toplevel->leave (s);
        }
@@ -1131,7 +1134,9 @@
        if (button->button != 1)
                return FALSE;
 
-       s->toplevel->handle_button (s, s->cb_up, button->state, button->x, 
button->y);
+       int x = button->x + widget->allocation.x;
+       int y = button->y + widget->allocation.y;
+       s->toplevel->handle_button (s, s->cb_up, button->state, x, y);
        return TRUE;
 }
 
@@ -1148,7 +1153,9 @@
        if (button->button != 1)
                return FALSE;
 
-       s->toplevel->handle_button (s, s->cb_down, button->state, button->x, 
button->y);
+       int x = button->x + widget->allocation.x;
+       int y = button->y + widget->allocation.y;
+       s->toplevel->handle_button (s, s->cb_down, button->state, x, y);
 }
 
 static int level = 0;

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

Reply via email to