mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
xwayland: always offer focus in Globally Active case
In 9e3785f8cd, a heuristic was added to assume that NORMAL and DIALOG
window types were always focusable. (This was before we had the "offer
focus" mechanism in place.)
However, we should still call wlr_xwayland_surface_offer_focus() for
these views, in case they actually don't want focus. (This is uncommon
but has recently been seen with WeChat popups, which have both NORMAL
and UTILITY type.)
To make this possible, refine view_wants_focus() to return either
LIKELY or UNLIKELY for Globally Active input windows. This decouples
the question of "should we try to focus this view" from the actual
mechanism used to do so.
This commit is contained in:
parent
97ce4131bb
commit
8fb2ecefcb
4 changed files with 22 additions and 12 deletions
|
|
@ -75,13 +75,18 @@ enum view_wants_focus {
|
|||
/* View wants focus */
|
||||
VIEW_WANTS_FOCUS_ALWAYS,
|
||||
/*
|
||||
* View should be offered focus and may accept or decline
|
||||
* (a.k.a. ICCCM Globally Active input model). Labwc generally
|
||||
* avoids focusing these views automatically (e.g. when another
|
||||
* view on top is closed) but they may be focused by user action
|
||||
* (e.g. mouse click).
|
||||
* The following values apply only to XWayland views using the
|
||||
* Globally Active input model per the ICCCM. These views are
|
||||
* offered focus and will voluntarily accept or decline it.
|
||||
*
|
||||
* In some cases, labwc needs to decide in advance whether to
|
||||
* focus the view. For this purpose, these views are classified
|
||||
* (by a heuristic) as likely or unlikely to want focus. However,
|
||||
* it is still ultimately up to the client whether the view gets
|
||||
* focus or not.
|
||||
*/
|
||||
VIEW_WANTS_FOCUS_OFFER,
|
||||
VIEW_WANTS_FOCUS_LIKELY,
|
||||
VIEW_WANTS_FOCUS_UNLIKELY,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue