fix(gtk): send key events directly to widgets (#3720)

The default behavior is to send them to the window first to activate
mnemonics and accelerators. Some accelerators conflict with text
selection hotkeys (like CTRL+A to select all torrents), this fixes that
conflict.
This commit is contained in:
bexnoss 2022-09-02 18:21:43 +02:00 committed by GitHub
parent 1062ae8f1f
commit 5782847601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -575,6 +575,14 @@ MainWindow::Impl::Impl(MainWindow& window, Glib::RefPtr<Gio::ActionGroup> const&
this);
refresh();
/* prevent keyboard events being sent to the window first */
window.signal_key_press_event().connect(
[this](GdkEventKey* event) { return gtk_window_propagate_key_event(static_cast<Gtk::Window&>(window_).gobj(), event); },
false);
window.signal_key_release_event().connect(
[this](GdkEventKey* event) { return gtk_window_propagate_key_event(static_cast<Gtk::Window&>(window_).gobj(), event); },
false);
}
void MainWindow::Impl::updateStats()