]> git.mdlowis.com Git - proto/labwc.git/commit
xwayland: use wlr_xwayland_surface_offer_focus()
authorJohn Lindgren <john@jlindgren.net>
Sat, 20 Jul 2024 15:25:10 +0000 (11:25 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 21 May 2025 18:30:19 +0000 (20:30 +0200)
commitc00baa16517a0b8135630219dc013a03212ab227
treec9f938bf25179f2fe0b10a0ee1335fa69dd03dec
parent95552c261daeec52b9fde36eb9ce2cf00be33ef3
xwayland: use wlr_xwayland_surface_offer_focus()

Offer focus by sending WM_TAKE_FOCUS to a client window supporting it.
The client may accept or ignore the offer. If it accepts, the surface will
emit a focus_in signal notifying the compositor that it has received focus.
The compositor should then call wlr_xwayland_surface_activate(surface, true).

This is a more compatible method of giving focus to windows using the
Globally Active input model (see wlr_xwayland_icccm_input_model()) than
calling wlr_xwayland_surface_activate() unconditionally, since there is no
reliable way to know in advance whether these windows want to be focused.

v2: add caution not to use view_offer_focus() directly
v3: remove obsolete comment
include/view.h
include/xwayland.h
src/desktop.c
src/view.c
src/xwayland.c