When using Scintilla on OS X with GTK Quartz backend scrolling is a bit too slow. At the moment Scintilla disables the adaptive speed scrolling heuristics it uses on other platforms when running on OS X. The comment says it's because of the X server's own heuristics but at the moment Scintilla does the same also when using Quartz backend where nothing like that seems to be present (at least based on my experiments). Fix is in the attached patch.
In addition, remove all the compiler checks - I believe simple APPLE should be enough to detect the platform.
Yeah, the bold APPLE means underscore-underscore-APPLE-underscore-underscore :-)
Using
GDK_WINDOWING_QUARTZis not a great way to check for Quartz-only code path because on GDK3 multiple backends can be supported at once, e.g. X11 and Quartz. Ideally you'd have a dynamicGDK_IS_QUARTZ_WINDOW(event->window)check (itself guarded by#if defined(GDK_WINDOWING_QUARTZ)).The original change was [18db24] from 2006 and its possible this is no longer required even for X11. If its not required then it should be removed. I don't have this set up so can't test it myself. Otherwise Colomban's suggestion looks good.
__APPLE__ is sufficient for platform detection.
Related
Commit: [18db24]
Argh! I give up (after 2 hours of trying with Gtk 2/3 and X11/Quartz backends).
The problem is this: one can do the dynamic backend check either by testing quartz availability using GDK_IS_QUARTZ_WINDOW() or testing X11 using GDK_IS_X11_WINDOW(). To do this, either gdk/gdkquartz.h or gdk/gdkx.h has to be included because the tests are only available from there. Now:
If I use GDK_IS_X11_WINDOW() and include gdk/gdkx.h, it also includes X headers and the definitions there (like Font, etc.) clash with the names in Scintilla when namespaces aren't used, which is the case of Geany.
If I use GDK_IS_QUARTZ_WINDOW() and include gdk/gdkquartz.h, Objective-C system headers get included which causes clang in g++ mode to report errors.
Attached is the (not working) patch implementing (2) just for reference.
Now, in my opinion, the whole multiple backend thing is not worth the trouble - first of all, I haven't seen Gtk 3 built both with X11 and Quartz backend (MacPorts uses separate builds, Homebrew has X11 only, JHBuild uses Quartz).
Second, the multiple backend problem affects only people using OS X, having Gtk 3 which is installed with both X and Quartz backends and who are using Scintilla with the X backend. I believe this set of people is empty (moreover, the worst thing that would happen is a bit too fast scrolling).
So I would suggest using the original patch.
P.S. There really seems to be some acceleration support in X on OS X so the test makes sense.
"Post awaiting moderation" - I just love you, Sourceforge.
Sorry about that - comment spam was a big problem on SourceForge a few years ago.
Committed original patch as [c313e8].
Related
Commit: [c313e8]