mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
desktop: allow re-focus between "globally active" views of the same PID
Commit7e72bf975fchanged behavior to not automatically focus xwayland views using the "Globally Active" input model (WM_HINTS.inputs = false but WM_TAKE_FOCUS listed in WM_PROTOCOLS). One undesired side effect of this change is that when a dialog is closed, the parent window is not re-focused if "Globally Active". This issue is seen for example with JDownloader. It can be solved taking a similar approach to what is done for unmanaged xwayland views: allow automatic re-focus between views sharing the same PID. Note that it's difficult to completely solve all of the focus issues with Globally Active views without proper WM_TAKE_FOCUS support. Implementing proper support is difficult since it requires wlroots changes and would also mean waiting for a message round-trip in desktop_focus_topmost_view(). Fixes (partially):7e72bf975f("view/xwayland: avoid focusing views that don't want focus")
This commit is contained in:
parent
dd7f563a50
commit
f6e3527767
3 changed files with 30 additions and 5 deletions
|
|
@ -290,6 +290,14 @@ void view_array_append(struct server *server, struct wl_array *views,
|
|||
|
||||
enum view_wants_focus view_wants_focus(struct view *view);
|
||||
|
||||
/**
|
||||
* view_is_focusable_from() - variant of view_is_focusable()
|
||||
* that takes into account the previously focused surface
|
||||
* @view: view to be checked
|
||||
* @prev_surface: previously focused surface
|
||||
*/
|
||||
bool view_is_focusable_from(struct view *view, struct wlr_surface *prev);
|
||||
|
||||
/**
|
||||
* view_is_focusable() - Check whether or not a view can be focused
|
||||
* @view: view to be checked
|
||||
|
|
@ -302,7 +310,10 @@ enum view_wants_focus view_wants_focus(struct view *view);
|
|||
* The only views that are allowed to be focusd are those that have a surface
|
||||
* and have been mapped at some point since creation.
|
||||
*/
|
||||
bool view_is_focusable(struct view *view);
|
||||
static inline bool
|
||||
view_is_focusable(struct view *view) {
|
||||
return view_is_focusable_from(view, NULL);
|
||||
}
|
||||
|
||||
void view_toggle_keybinds(struct view *view);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue