From 73ec2adb7b4b4a1a6d3b15b9dc9087941316a4c9 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 6 Feb 2023 19:06:48 -0500 Subject: fix some keybinds not working in the chat input (fixes #135) --- src/components/chatinput.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/components/chatinput.cpp') 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(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(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; -- cgit v1.2.3