mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
experimental: 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.
This commit is contained in:
parent
179a030bbe
commit
22b193254c
5 changed files with 47 additions and 10 deletions
|
|
@ -94,6 +94,7 @@ struct view_impl {
|
|||
struct view_size_hints (*get_size_hints)(struct view *self);
|
||||
/* if not implemented, VIEW_WANTS_FOCUS_ALWAYS is assumed */
|
||||
enum view_wants_focus (*wants_focus)(struct view *self);
|
||||
void (*offer_focus)(struct view *self);
|
||||
};
|
||||
|
||||
struct view {
|
||||
|
|
@ -320,6 +321,8 @@ view_is_focusable(struct view *view) {
|
|||
return view_is_focusable_from(view, NULL);
|
||||
}
|
||||
|
||||
void view_offer_focus(struct view *view);
|
||||
|
||||
void view_toggle_keybinds(struct view *view);
|
||||
|
||||
void view_set_activated(struct view *view, bool activated);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ struct xwayland_view {
|
|||
struct wl_listener set_decorations;
|
||||
struct wl_listener set_override_redirect;
|
||||
struct wl_listener set_strut_partial;
|
||||
struct wl_listener focus_in;
|
||||
|
||||
/* Not (yet) implemented */
|
||||
/* struct wl_listener set_role; */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue