Hi all,

I am experiencing some very annoying mouse cursor flicker on a particular
computer system which does not occur on any other machine. I am using a
GTK+3 GtkDrawingArea widget, and am listening for GDK_POINTER_MOTION_MASK
events on that widget. When I get such an event, I do some redrawing to
a private Cairo surface based on the current cursor location, then
queue an expose event with gtk_widget_queue_draw_area(drawarea, ...). 
When my GtkDrawingArea widget receives the 'draw' signal it copies the 
redrawn area of interest from my private Cairo surface using this draw 
handler:

gboolean
canvasdrawevt(GtkWidget *w, cairo_t *cr, gpointer gp)
{
        MyCairoCanvas *c;

        c= (MyCairoCanvas *) gp;

        cairo_set_source_surface(cr, c->surface, 0, 0);
        cairo_rectangle(cr, 0, 0, (double) c->width, (double) c->height);
        cairo_fill(cr);

        return TRUE;
}

After my redraw is done, on the problematic machine the mouse cursor
actually disappears from view completely. If I move the mouse around
quickly, generating lots of these redraws, I can see the cursor flickering
until I stop moving it, after which it again disappears. There are certain
areas of the widget where I do *not* handle these motion events and thus
there is no redrawing done -- in these areas the mouse cursor behaves
normally and is always visible.

This is happening on a CentOS 6 system that is several (maybe about 8)
years old. This problem does not occur on any of the other CentOS 6 systems
I have which are newer hardware. It also does not occur on the older system
if I run my app remotely via a VNC server, displaying on newer hardware.

Any idea on what is causing this or how I might work around it? Unfortunately
I really do need to run this app on the old machine. I have looked around
GDK for some type of cursor flush/redraw routine but can't seem to find
any such thing. If there was a way to force a cursor redraw I might be able
to work around this, although I'm not sure how I could guarantee that the
cursor redraw would happen after the expose event is actually handled by
my draw handler.

Thanks!

Roger Davis
Univ. of Hawaii
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to