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:
parent
1062ae8f1f
commit
5782847601
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue