summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2022-08-09 21:09:08 +0200
committerChristian Persch <chpe@src.gnome.org>2022-08-09 21:09:08 +0200
commit1fb0b0cce5766c7a6ce42136e145d03f68c94c7b (patch)
tree4c685e6fda3917b65179d20f0ba68db38a0b3d89
parent5897ee10d53d220671fcd3a3ed96273f6151df80 (diff)
downloadvte-1fb0b0cce5766c7a6ce42136e145d03f68c94c7b.tar.gz
widget: gtk4: Only notify terminal when focused
https://gitlab.gnome.org/GNOME/vte/-/issues/2555#note_1524795 (cherry picked from commit 70366d113516382038c69f863c9915753041e563)
-rw-r--r--src/widget.cc6
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