mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 11:51:27 +00:00
* 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:
parent
3689ee5c35
commit
6866ad9961
2 changed files with 18 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue