aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
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 /gtk/PlatGTK.cxx
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/
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rwxr-xr-xgtk/PlatGTK.cxx6
1 files changed, 6 insertions, 0 deletions
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);