gdk/wayland: Use toplevel surface for activation
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 18 Sep 2023 20:04:32 +0000 (22:04 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Sep 2023 20:32:27 +0000 (16:32 -0400)
commit1f774e20445ab8fdf5e6c4086a29606e8b0597df
treea576777d7b4113389458bd8df4ecb4cd06b08369
parentabf22e3edda214dcf572cb9c2dfd13cccc2619c6
gdk/wayland: Use toplevel surface for activation

At the moment of launching/activating an application, the
keyboard focus may be on a transient surface that quickly
disappears after activation. If this happens, and the
compositor handles surface destruction before the activated
application gets to reply, the activation request may be
deemed outdated, and the "demands attention" paths be taken.

Peek the toplevel from the focus surface, as that has larger
guarantees to remain valid for the whole duration of the
operation.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5820
gdk/wayland/gdkapplaunchcontext-wayland.c