From febf786cd2dbc098b565dfd776bf4310deb10eaf Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 23 Mar 2016 13:42:15 +0100 Subject: [PATCH] TextView::on_key_press_event workaround: another fix for dead keys --- src/source.cc | 5 +++-- src/source.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/source.cc b/src/source.cc index c4c6c5c..cb90111 100644 --- a/src/source.cc +++ b/src/source.cc @@ -1058,7 +1058,8 @@ bool Source::View::on_key_press_event(GdkEventKey* key) { return true; } - previous_keyval=last_keyval; + if(last_keyvalGDK_KEY_Hyper_R) + previous_non_modifier_keyval=last_keyval; last_keyval=key->keyval; if(get_buffer()->get_has_selection()) @@ -1290,7 +1291,7 @@ bool Source::View::on_key_press_event_basic(GdkEventKey* key) { //Note: valgrind reports issues on TextView::on_key_press_event as well auto unicode=gdk_keyval_to_unicode(key->keyval); if((key->state&(GDK_CONTROL_MASK|GDK_META_MASK))==0 && unicode>=32 && unicode!=127 && - (previous_keyvalGDK_KEY_dead_greek)) { + (previous_non_modifier_keyvalGDK_KEY_dead_greek)) { if(get_buffer()->get_has_selection()) { Gtk::TextIter selection_start, selection_end; get_buffer()->get_selection_bounds(selection_start, selection_end); diff --git a/src/source.h b/src/source.h index 93c8adb..f9af6a3 100644 --- a/src/source.h +++ b/src/source.h @@ -154,7 +154,7 @@ namespace Source { bool spellcheck_all=false; std::unique_ptr spellcheck_suggestions_dialog; - guint previous_keyval=0; + guint previous_non_modifier_keyval=0; guint last_keyval=0; private: GtkSourceSearchContext *search_context;