diff options
author | Christian Persch <chpe@src.gnome.org> | 2022-08-09 21:08:06 +0200 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2022-08-09 21:08:06 +0200 |
commit | 70366d113516382038c69f863c9915753041e563 (patch) | |
tree | eb468f4064960b747b4c8994ab0a338be1eee47e | |
parent | d7b1da6f8203a732fdc850b991236708adc0d52f (diff) | |
download | vte-70366d113516382038c69f863c9915753041e563.tar.gz |
widget: gtk4: Only notify terminal when focused
https://gitlab.gnome.org/GNOME/vte/-/issues/2555#note_1524795
-rw-r--r-- | src/widget.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widget.cc b/src/widget.cc index 4cf69c79..5cc2b8fe 100644 --- a/src/widget.cc +++ b/src/widget.cc @@ -1717,7 +1717,11 @@ Widget::root_surface_state_notify() m_root_surface_state = new_state; - if (changed_mask & GDK_TOPLEVEL_STATE_FOCUSED) { + // If the widget is the focus widget in the toplevel, notify + // the widget that it now has gained/lost the global focus + if ((changed_mask & GDK_TOPLEVEL_STATE_FOCUSED) && + gtk_root_get_focus(r) == gtk()) { + if (root_focused()) terminal()->widget_focus_in(); else |