aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2006-12-19 23:06:42 +0000
committernyamatongwe <devnull@localhost>2006-12-19 23:06:42 +0000
commit63d09c64315b2bef81b7a66e89f17d9b720f9ffc (patch)
treead8475daacff4fbbebce4e81fb777b97b4c16a56
parent0c4ca75a6eecbfd7dcca835997e0ac1ae61018e9 (diff)
downloadscintilla-mirror-63d09c64315b2bef81b7a66e89f17d9b720f9ffc.tar.gz
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.
-rw-r--r--gtk/ScintillaGTK.cxx11
1 files changed, 10 insertions, 1 deletions
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);