summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/chatinput.cpp11
-rw-r--r--src/components/chatinput.hpp3
2 files changed, 12 insertions, 2 deletions
diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp
index 4c4c866..d19ac4b 100644
--- a/src/components/chatinput.cpp
+++ b/src/components/chatinput.cpp
@@ -11,7 +11,10 @@ ChatInputText::ChatInputText() {
// hack
auto cb = [this](GdkEventKey *e) -> bool {
- return event(reinterpret_cast<GdkEvent *>(e));
+ // we cant use Widget::event here specifically or else for some reason
+ // it prevents the default binding set from activating sometimes
+ // specifically event() will return true (why) preventing default handler from running
+ return m_signal_key_press_proxy.emit(e);
};
m_textview.signal_key_press_event().connect(cb, false);
m_textview.set_hexpand(false);
@@ -90,12 +93,16 @@ ChatInputText::type_signal_image_paste ChatInputText::signal_image_paste() {
return m_signal_image_paste;
}
+ChatInputText::type_signal_key_press_proxy ChatInputText::signal_key_press_proxy() {
+ return m_signal_key_press_proxy;
+}
+
ChatInputTextContainer::ChatInputTextContainer() {
// triple hack !!!
auto cb = [this](GdkEventKey *e) -> bool {
return event(reinterpret_cast<GdkEvent *>(e));
};
- m_input.signal_key_press_event().connect(cb, false);
+ m_input.signal_key_press_proxy().connect(cb);
m_upload_img.property_icon_name() = "document-send-symbolic";
m_upload_img.property_icon_size() = Gtk::ICON_SIZE_LARGE_TOOLBAR;
diff --git a/src/components/chatinput.hpp b/src/components/chatinput.hpp
index 3b7bc79..bc6a45d 100644
--- a/src/components/chatinput.hpp
+++ b/src/components/chatinput.hpp
@@ -83,15 +83,18 @@ public:
using type_signal_submit = sigc::signal<bool, Glib::ustring>;
using type_signal_escape = sigc::signal<void>;
using type_signal_image_paste = sigc::signal<void, Glib::RefPtr<Gdk::Pixbuf>>;
+ using type_signal_key_press_proxy = sigc::signal<bool, GdkEventKey *>;
type_signal_submit signal_submit();
type_signal_escape signal_escape();
type_signal_image_paste signal_image_paste();
+ type_signal_key_press_proxy signal_key_press_proxy();
private:
type_signal_submit m_signal_submit;
type_signal_escape m_signal_escape;
type_signal_image_paste m_signal_image_paste;
+ type_signal_key_press_proxy m_signal_key_press_proxy;
};
// file upload, text