+2007-04-25 Jim Evins <evins@snaught.com>
+
+ * src/view.h:
+ * src/view.c: (gl_view_update), (expose_cb),
+ (motion_notify_event_cb), (button_press_event_cb),
+ (button_release_event_cb):
+ - Try not to let updates get backed up.
+ - Grab pointer when doing any drag operations.
+
2007-04-11 Jim Evins <evins@snaught.com>
* src/cairo-label-path.c: (gl_cairo_label_path),
if (!widget->window) return;
- region = gdk_drawable_get_clip_region (widget->window);
- /* redraw the cairo canvas completely by exposing it */
- gdk_window_invalidate_region (widget->window, region, TRUE);
+ if ( !view->update_scheduled_flag )
+ {
+ view->update_scheduled_flag = TRUE;
- gdk_region_destroy (region);
+ region = gdk_drawable_get_clip_region (widget->window);
+ /* redraw the cairo canvas completely by exposing it */
+ gdk_window_invalidate_region (widget->window, region, TRUE);
+ gdk_region_destroy (region);
+ }
gl_debug (DEBUG_VIEW, "END");
}
gl_debug (DEBUG_VIEW, "START");
+ view->update_scheduled_flag = FALSE;
+
/* get a cairo_t */
cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window);
cairo_destroy (cr);
+ /*
+ * FIXME: we re-establish grabs here if the grab has been lost. We seem to be
+ * losing grabs when we emit signals that lead to the manipulation of
+ * the GtkUIManager. Needs more investigation
+ */
+ if (view->grabbed_flag && !gdk_pointer_is_grabbed ())
+ {
+ gdk_pointer_grab (GTK_LAYOUT (view->canvas)->bin_window,
+ FALSE,
+ (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK),
+ NULL,
+ NULL,
+ event->time);
+ }
+
return return_value;
}
default:
g_message ("Invalid view mode."); /*Should not happen!*/
}
+
+ view->grabbed_flag = TRUE;
+ gdk_pointer_grab (GTK_LAYOUT (view->canvas)->bin_window,
+ FALSE,
+ (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK),
+ NULL,
+ NULL,
+ event->time);
break;
case 3:
{
case 1:
+ view->grabbed_flag = FALSE;
+ gdk_pointer_ungrab (event->time);
/*
* Handle event as appropriate for mode
*/