How to avoid POINTER_MOTION events for not active windows?



I am working on a simple linux/gnome/gtk/cairo/ruby application similar
to http://www.ssalewski.de/PetEd-Demo.html.en

I want to get POINTER_MOTION events when mouse pointer is in my GTK
drawing area.

When I call add_events() for my drawing area with flag
Gdk::Event::POINTER_MOTION_MASK I get motion events whenever the mouse
pointer is over/in my drawing area, even when the window containing that
drawing area is not active.

This was surprising for me. I want events only when the window is the
active one. What is the correct method to achieve that behavior?

Thanks,

Stefan Salewski





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]