* Source/x11/XGServerEvent.m (-processEvent:): Rewrite coalescing

code to only combine an uninterrupted set of scroll events.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@34558 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2012-01-17 00:43:29 +00:00
parent 3689ee5c35
commit 6866ad9961
2 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2012-01-16 Eric Wasylishen <ewasylishen@gmail.com>
* Source/x11/XGServerEvent.m (-processEvent:): Rewrite coalescing
code to only combine an uninterrupted set of scroll events.
2012-01-15 Eric Wasylishen <ewasylishen@gmail.com>
* Source/x11/XGServerEvent.m (-processEvent:): Coalesce

View file

@ -377,17 +377,24 @@ posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor
(xEvent.xbutton.button == generic.downMouse
&& generic.downMouse != 0))
{
XEvent peek;
while (XCheckTypedWindowEvent(xEvent.xbutton.display,
xEvent.xbutton.window,
ButtonPress,
&peek))
while (XPending(xEvent.xbutton.display))
{
if (xEvent.xbutton.button == peek.xbutton.button
XEvent peek;
XPeekEvent(xEvent.xbutton.display, &peek);
/*
* A stream of scroll events seems to consist of
* a press followed by several releases
*/
if ((ButtonPress == peek.type
|| ButtonRelease == peek.type)
&& xEvent.xbutton.window == peek.xbutton.window
&& xEvent.xbutton.button == peek.xbutton.button
&& xEvent.xbutton.x == peek.xbutton.x
&& xEvent.xbutton.y == peek.xbutton.y)
{
scrollDelta += 1.0;
XNextEvent(xEvent.xbutton.display, &xEvent);
}
else
{