aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/ScintillaGTK.cxx
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2021-09-19 11:55:08 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2021-09-19 11:55:08 +1000
commitb9ad43e8b1cfaa7213be0eb33ed179285c33c67a (patch)
tree6cda8c80b3ff5c5efb3764fbb87fa96b11848b1f /gtk/ScintillaGTK.cxx
parent0e05823e5c021e2368c885743092450a199ef16e (diff)
downloadscintilla-mirror-b9ad43e8b1cfaa7213be0eb33ed179285c33c67a.tar.gz
Respond to changes in system font scaling by clearing any cached layout data.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rwxr-xr-xgtk/ScintillaGTK.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 7b47d6348..92973a083 100755
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -231,6 +231,7 @@ ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) :
im_context(nullptr),
lastNonCommonScript(G_UNICODE_SCRIPT_INVALID_CODE),
settings(nullptr),
+ settingsHandlerId(0),
lastWheelMouseTime(0),
lastWheelMouseDirection(0),
wheelMouseIntensity(0),
@@ -277,6 +278,9 @@ ScintillaGTK::~ScintillaGTK() {
}
ClearPrimarySelection();
wPreedit.Destroy();
+ if (settingsHandlerId) {
+ g_signal_handler_disconnect(settings, settingsHandlerId);
+ }
if (settings) {
g_object_unref(settings);
}
@@ -357,6 +361,15 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) {
cursor = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);
gdk_window_set_cursor(PWindow(scrollbarh), cursor);
UnRefCursor(cursor);
+
+ using NotifyLambda = void (*)(GObject *, GParamSpec *, ScintillaGTK *);
+ if (settings) {
+ settingsHandlerId = g_signal_connect(settings, "notify::gtk-xft-dpi",
+ G_CALLBACK(static_cast<NotifyLambda>([](GObject *, GParamSpec *, ScintillaGTK *sciThis) {
+ sciThis->InvalidateStyleRedraw();
+ })),
+ this);
+ }
}
void ScintillaGTK::Realize(GtkWidget *widget) {