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



Paul Barton-Davis <pbd@op.net> writes:

> 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.

Well, at the beginning of gdkwindow we have (gtk+ 1.2.6):

const int gdk_event_mask_table[20] =
{
  ExposureMask,
  PointerMotionMask,
  PointerMotionHintMask,
  ButtonMotionMask,
  Button1MotionMask,
  Button2MotionMask,
  Button3MotionMask,
  ButtonPressMask | OwnerGrabButtonMask,
  ButtonReleaseMask | OwnerGrabButtonMask,
  KeyPressMask,

[snip the rest of the table]

This table is used to map gdk's event masks to Xlib's event masks and
OwnerGrabButtonMask is obviously set everytime you set either
ButtonPressMask or ButtonReleaseMask.

> 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.

Hmm. I grep'ed though my mails and what I've found is a mail from Owen
stating:

	But we'll be making a change in GTK+-1.4 (Removing
	OwnerButtonPressGrab from the event mask) that will allow using
	the automatic X button-press-grab more frequently. The advantage
	of doing this is that that grab is automatically released on
	button-up, even when your program is stopped.


That's good news! This OwnerButtonPressGrab 'feature' was one of the
first things I stumbled over when I started to port Sketch from Tk to
GTK, so I'm glad to see it go away.

-- 
Bernhard Herzog	  | Sketch, a drawing program for Unix
herzog@online.de  | http://www.online.de/home/sketch/



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