X11 vs. Windows and pointer motion hints



Am I confused, or is there something strange in
gtk_list_motion_notify? gdk_window_get_pointer(widget->window, &x, &y,
NULL) is called only if (event->is_hint || event->window !=
widget->window), but still x and y are used without any checking
later.

As you might guess my problems appears in the Windows port, where
there is no concept of pointer motion hints. Until now I have set the
is_hint member always to zero (= NotifyNormal). This caused lists to
misbehave. x and y had random values, and if you tried to drag-select,
the list always scrolled to the bottom.

Basically what I mean is that I am a bit confused about whether we
really can be sure (on X11) that always either
event->is_hint==NotifyHint or event->window!=widget->window here? (I
guess yes, as the code works OK on X11...) The X11 documentation on
when the is_hint is set in the pointer motion notify events is not
that awfully clear. Might there be any harm to GTK if I always set the
is_hint member in GDK_MOTION_NOTIFY events to nonzero (NotifyHint)?
Or should I set it to nonzero only if the window (or the grabbing
window) is interested in motion hints?

P.S. I have now implemented a partial emulation of pointer grabbing,
so scrollbars and especially panes work much better now. (No, I didn't
have time to put up a snapshot with these changes yet.) Also, the gimp
pattern selecor's preview windows pop down correctly.

--tml



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