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



Thanks for your and Bernhard's comments.  I tried testgtk.c and it worked
just as you described.  I've made sure I'm using the exact same signals, and
calls to gtk_grab_add and gdk_pointer_grab with the same masks in the same
order, yet I'm not getting the same results.  I wonder if there is a
difference because the shapes are top level widgets, and I am trying to do
this on an event_box?

We're in the middle of finals here at the Air Force Academy, so I haven't
had lots of time to work on this.  I'll try to post a small sample program
after I strip down what I am doing.

--Martin

-----Original Message-----
From: Paul Barton-Davis [mailto:pbd@op.net]
Sent: Sunday, December 12, 1999 11:38 AM
To: gtk-list@redhat.com
Subject: [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

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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