From 63d09c64315b2bef81b7a66e89f17d9b720f9ffc Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 19 Dec 2006 23:06:42 +0000 Subject: Patch from Stephan Deibel to disable the adaptive mouse wheel scrolling algorithm on OS X because there the most common X11 server (Apple's) already includes an algorithm like this that ends up magnifying the magnifications. --- gtk/ScintillaGTK.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gtk') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 269c59e91..6ad3e3a24 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1807,7 +1807,15 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget, // Compute amount and direction to scroll (even tho on win32 there is // intensity of scrolling info in the native message, gtk doesn't // support this so we simulate similarly adaptive scrolling) + // Note that this is disabled on OS X (Darwin) where the X11 server already has + // and adaptive scrolling algorithm that fights with this one int cLineScroll; +#if defined(__MWERKS__) || defined(__APPLE_CPP__) || defined(__APPLE_CC__) + cLineScroll = sciThis->linesPerScroll; + if (cLineScroll == 0) + cLineScroll = 4; + sciThis->wheelMouseIntensity = cLineScroll; +#else int timeDelta = 1000000; GTimeVal curTime; g_get_current_time(&curTime); @@ -1825,6 +1833,7 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget, cLineScroll = 4; sciThis->wheelMouseIntensity = cLineScroll; } +#endif if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT) { cLineScroll *= -1; } @@ -1841,7 +1850,7 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget, return FALSE; } - // Horizontal scrolling + // Horizontal scrolling if (event->direction == GDK_SCROLL_LEFT || event->direction == GDK_SCROLL_RIGHT) { sciThis->HorizontalScrollTo(sciThis->xOffset + cLineScroll); -- cgit v1.2.3