Re: [gtk-list] Re: problem with grabbing pointer



>> it does. you must have a mistake in your code. take a look at the
>> example code in testgtk.c covering shaped windows. you'll find stuff
>> that does this for shaped windows that you can drag around the screen
>> at will.
>
>No, he's right. testgtk.c does an explicit gdk_pointer_grab().

Sorry, I was confusing the buttonPress/Release grab with the more
general pointer grab. 

>The reason for the effect Martin described is that gdk sets the
>OwnerGrabButtonMask flag in gdkwindow.c . Without this flag, X does an
>automatic pointer grab and motion events and the final button release
>event are sent to the window where the button press occurred and mouse
>positions are reported relative to the origin of that window. When the
>flag is set there's no automatic pointer grab and the events go to
>whatever window is under the cursor and the positions are relative to
>that window. (this is a bit simplified).
>
>I have no idea why gdk sets that flag, though.

Are you sure its set ? This is not the behaviour that most GTK
programs demonstrate ... everything that I know reports buttonRelease
to the same window as the buttonPress occured in. Also, I recall Owen
or Havoc pointing out last week that GTK is in big trouble if you play
games so that a widget that received buttonPress does not receive the
corresponding buttonRelease.

Motion events are something else, however. Anyway, my point stands: if
you run the testgtk program and use the shaped window test, you can
drag the windows/icons around at any speed, and it works just fine.

--p



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