return hits;
}
-static gboolean on_motion_notify(GritsOpenGL *opengl, GdkEventMotion *event, gpointer _)
+static gboolean run_mouse_move(GritsOpenGL *opengl, GdkEventMotion *event)
{
gdouble height = GTK_WIDGET(opengl)->allocation.height;
gdouble gl_x = event->x;
GdkCursor *topcursor = top && top->cursor ? top->cursor : cursor;
gdk_window_set_cursor(window, topcursor);
- g_debug("GritsOpenGL: on_motion_notify - hits=%d/%d,%d/%d ev=%.0lf,%.0lf",
+ g_debug("GritsOpenGL: run_mouse_move - hits=%d/%d,%d/%d ev=%.0lf,%.0lf",
world_hits, world->len, ortho_hits, ortho->len, gl_x, gl_y);
g_ptr_array_free(world, TRUE);
return FALSE;
}
+static gboolean on_motion_notify(GritsOpenGL *opengl, GdkEventMotion *event, gpointer _)
+{
+ opengl->mouse_queue = *event;
+ gtk_widget_queue_draw(GTK_WIDGET(opengl));
+ return FALSE;
+}
+
static void _draw_level(gpointer _level, gpointer _opengl)
{
GritsOpenGL *opengl = _opengl;
g_debug("GritsOpenGL: on_expose - begin");
if (opengl->pickmode)
- return on_motion_notify(opengl, (GdkEventMotion*)event, NULL);
+ return run_mouse_move(opengl, (GdkEventMotion*)event);
+
+ if (opengl->mouse_queue.type != GDK_NOTHING) {
+ run_mouse_move(opengl, &opengl->mouse_queue);
+ opengl->mouse_queue.type = GDK_NOTHING;
+ }
gtk_gl_begin(GTK_WIDGET(opengl));