Re: High-resolution scroll events



Hi,

Am Mittwoch, den 17.11.2010, 16:25 +0100 schrieb Max Schwarz:
> > > Do you have an idea on how to implement this? I think Qt's model is quite
> > > nice, they have a 'delta' field in their event [3] which gives more
> > > precise information. Of course, If you want to retain API compability
> > > (which I think you do) a new event would have to be introduced that is
> > > emitted in parallel.
> > 
> > No, you don't have to. Here is a patch for the Mac OS X backend which
> > implements this. (Let me check tonight whether I can find my cleaned up
> > version and attach it to that bug.)

So, I updated to patch to something that applies to the current master
branch.

> But that would mean changing the frequency of the events, correct?
> For every small wheel delta a new event has to be sent. Can current software 
> cope with that? I'd expect that it starts scrolling wildly ;-)

Not at all. Because the widgets (usually) only modify GtkAdjustment and
with that patch, the modification gets scaled with delta. So, if you
emit 10 times more events and let them have a delta of 0.1, you'll still
have the same effect (except for broken implementations outside of GTK+,
but those will be pretty obviously broken in the way that they will
scroll in huge steps and it will be difficult to accurately scroll at
all -- those will have to be fixed to respect delta as well).

> The problem is not with large deltas (which are thrown away in the current OSX 
> version, if I understand the patch correctly), but with small deltas, which 
> get emitted from Xorg with a pretty high frequency.

No, right now we implement the current X11 logic of scrolling on Mac OS
X as well. There used to be multiple GdkEvents per NSEvent (but that
didn't work out properly and thus, way reverted).

So, feel free to go ahead with the patch I attached and you will see
that applications without custom widgets work perfectly once you adapt
the X11 backend of GDK to use the delta field as well.

Regards,
  Sven



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