]> git.sur5r.net Git - glabels/commitdiff
Pointer events are now generated for all modes.
authorJim Evins <evins@snaught.com>
Tue, 15 Oct 2002 03:56:18 +0000 (03:56 +0000)
committerJim Evins <evins@snaught.com>
Tue, 15 Oct 2002 03:56:18 +0000 (03:56 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@164 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/view.c

index 230dea8fc39ec67b70b5a5df5fa533a36b1e491d..150b672bda60be065fb315c76c2fe22286a6265d 100644 (file)
@@ -1792,8 +1792,30 @@ canvas_event (GnomeCanvas *canvas,
              GdkEvent    *event,
              glView      *view)
 {
+       gdouble x, y;
+
        gl_debug (DEBUG_VIEW, "");
 
+       /* emit pointer signals regardless of state */
+       switch (event->type) {
+       case GDK_MOTION_NOTIFY:
+               gl_debug (DEBUG_VIEW, "MOTION_NOTIFY");
+               gnome_canvas_window_to_world (canvas,
+                                             event->motion.x,
+                                             event->motion.y, &x, &y);
+               g_signal_emit (G_OBJECT(view), signals[POINTER_MOVED], 0, x, y);
+               break; /* fall through */
+
+       case GDK_LEAVE_NOTIFY:
+               gl_debug (DEBUG_VIEW, "LEAVEW_NOTIFY");
+               g_signal_emit (G_OBJECT(view), signals[POINTER_EXIT], 0);
+               break; /* fall through */
+
+       default:
+               break; /* fall through */
+       }
+
+
        switch (view->state) {
 
        case GL_VIEW_STATE_ARROW:
@@ -1937,7 +1959,6 @@ canvas_event_arrow_mode (GnomeCanvas *canvas,
                gnome_canvas_window_to_world (canvas,
                                              event->motion.x,
                                              event->motion.y, &x, &y);
-               g_signal_emit (G_OBJECT(view), signals[POINTER_MOVED], 0, x, y);
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        gnome_canvas_item_set (item,
                                               "x1", MIN (x, x0),
@@ -1949,11 +1970,6 @@ canvas_event_arrow_mode (GnomeCanvas *canvas,
                        return FALSE;
                }
 
-       case GDK_LEAVE_NOTIFY:
-               gl_debug (DEBUG_VIEW, "LEAVEW_NOTIFY");
-               g_signal_emit (G_OBJECT(view), signals[POINTER_EXIT], 0);
-               return FALSE;
-
        case GDK_KEY_PRESS:
                gl_debug (DEBUG_VIEW, "KEY_PRESS");
                if (!dragging) {