aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJiří Techet <techet@gmail.com>2025-02-06 08:11:01 +1100
committerJiří Techet <techet@gmail.com>2025-02-06 08:11:01 +1100
commit75ac401067792ada13497cc886961a2f6678cbe0 (patch)
tree61c273d7e9789cdf55111348c5230cea5488c2ff
parent9fc06a288db158b517873bfccc2750a2281b669b (diff)
downloadscintilla-mirror-75ac401067792ada13497cc886961a2f6678cbe0.tar.gz
Bug [#2460]. Workaround incorrect scaling of "reverse arrow" cursor under Windows
and HiDPI screens The GDK_RIGHT_PTR cursor is provided only by GTK - there's no native Windows cursor of this shape so GTK renders the cursor by itself from the cursor theme bitmap. The code doing this is apparently buggy and does not take into account HiDPI screens so on a screen with 300% scaling, the cursor is 3x smaller. Workaround this by using GDK_HAND2 which maps to a native Windows cursor that doesn't suffer from this problem. See https://sourceforge.net/p/scintilla/bugs/2460/
-rw-r--r--doc/ScintillaHistory.html4
-rwxr-xr-xgtk/PlatGTK.cxx6
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 95b212749..5bcc93dfb 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -608,6 +608,10 @@
Fix segmentation of long lexemes to avoid breaking before modifiers like accents that must be drawn with their base letters.
</li>
<li>
+ For GTK on Windows, replace reverse arrow cursor with hand as reverse arrow was small in scaled modes.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2460/">Bug #2460</a>.
+ </li>
+ <li>
Fix bug on Qt where double-click stopped working when Scintilla instance had been running for weeks.
</li>
</ul>
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 0378cc44d..67b7f7052 100755
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1346,7 +1346,13 @@ void Window::SetCursor(Cursor curs) {
gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_HAND2);
break;
case Cursor::reverseArrow:
+#ifdef G_OS_WIN32
+ // GDK_RIGHT_PTR is scaled incorrectly under Windows with HiDPI screens (GTK 3.24);
+ // GDK_HAND2 is mapped to a native Windows cursor by GTK
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_HAND2);
+#else
gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_RIGHT_PTR);
+#endif
break;
default:
gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);