Re: Events in gtk




Andy Thomas <alt@picnic.demon.co.uk> writes:

> Hi,
> 
> I am looking at a problem with the transform tool in the gimp and
> have a problem with events in gtk. 
> 
> It seems that I am getting a motion event with the button1 mask down before
> I get the press event for button1. It seems strange but is that OK?

The problem lies in the GIMP:

It always calls gdk_window_get_pointer() and uses the mask from that
on every motion event. If a motion event is in the queue immediately
before the button press, when the GIMP queries the pointer, the
BUTTON1 mask will be down before the button_press event is processed.

In my XInput patches, I've changed things so that it discards the
information obtained from gdk_window_get_pointer() - so this problem
doesn't occur.  (The function still needs to be called on motion
events with event->hint set so that X will know to send another motion
event) It means that the drawing lags the pointer a bit more, though.

(The other thing to do would be to ignore the button press events
completely and synthesize them from the return of
gdk_window_get_pointer(), but that may be a bit tricky to get right -
right mouse button clicks to pop up the menu almost certainly should
_not_ be simulated, for instance.)

Regards,
                                        Owen






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