Change gdk_event_get ?




First, I should admit that I was babbling about gdk_event_get and
predicates. It is not completely broken - in fact it should work
OK most of the time. But I still think it is somewhat broken,
as I'll explain below.

I'd like to make some backwards-incompatible changes to gdk_event_get().

Namely, change:

  gint gdk_event_get (GdkEvent     *event,
	  	      GdkEventFunc  pred,
	              gpointer      data);

to 

  GdkEvent *gdk_event_get ();

So, there are two changes here:

1) GdkEvent's become dynamically allocated structures. This is
necessary with the XIM patches because the translation of a
single keystroke can be arbitrarily long. (The user may have
entered a novel into the Input Manager, then hit the "send
to application" key.) I think this can be done without much
of a performance hit using GMemChunk's.

2) The predicate stuff is removed. This is because I don't still think
it works right - various things that have been added to
gdk_event_translate assume that they will only be called once for each
X event. 

It is, as far as I know, used in only one place in the GIMP; in that
spot (handling GraphicsExpose events), a special purpose routine
would be considerably more efficient and not hard too write. 

If somebody needs general predicate handling later, we can add another
function which does it (and fix everything that that requires)

The other alternatives would be to:

- Depreciate the predicate handling but leave it in to be fixed later.

or 

- Fix it. Which basically means:
 
 * ignoring key press events because XIM can't handle keys multiple
   times.
 * ignoring motion/button/enter/leave events because
    a) DND handling is stateful
    b) The XInput code may make some events vanish depending on
       what events precede them.
 * ignore some other events for various reasons.

 By which time it's barely better than a special purpose routine
 anyways.

As far as I know, backwards incompatibility isn't a problem with
gdk_event_get - I think it is used into a total of two places.

Regards,
                                        Owen



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