From: Jim Evins Date: Tue, 15 Oct 2002 03:56:18 +0000 (+0000) Subject: Pointer events are now generated for all modes. X-Git-Tag: glabels-2_3_0~723 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=128e0c135f9048b32de6c0ac6c1a46f6f7140baa;p=glabels Pointer events are now generated for all modes. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@164 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/view.c b/glabels2/src/view.c index 230dea8f..150b672b 100644 --- a/glabels2/src/view.c +++ b/glabels2/src/view.c @@ -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) {