summarylogtreecommitdiffstats
path: root/textentry_gtk_suppressevents.patch
diff options
context:
space:
mode:
Diffstat (limited to 'textentry_gtk_suppressevents.patch')
-rw-r--r--textentry_gtk_suppressevents.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/textentry_gtk_suppressevents.patch b/textentry_gtk_suppressevents.patch
new file mode 100644
index 00000000000..05e7f32dcde
--- /dev/null
+++ b/textentry_gtk_suppressevents.patch
@@ -0,0 +1,26 @@
+--- src/gtk/textentry_old.cpp 2018-11-01 00:03:31.952106203 +0100
++++ src/gtk/textentry.cpp 2018-11-01 00:03:43.116101966 +0100
+@@ -561,10 +561,20 @@
+ EventsSuppressor noevents(this);
+ Remove(0, -1);
+ }
+- EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
+- WriteText(value);
++
++ // Testing whether value is empty here is more than just an
++ // optimization: WriteText() always generates an explicit event in
++ // wxGTK, which we need to avoid unless SetValue_SendEvent is given.
++ if ( !value.empty() )
++ {
++ // Suppress events from here even if we do need them, it's simpler
++ // to send the event below in all cases.
++ EventsSuppressor noevents(this);
++ WriteText(value);
++ }
+ }
+- else if (flags & SetValue_SendEvent)
++
++ if (flags & SetValue_SendEvent)
+ SendTextUpdatedEvent(GetEditableWindow());
+
+ SetInsertionPoint(0);