Make focusing newly mapped views optional (strict focus stealing prevention)#2627
Draft
dkondor wants to merge 10 commits intoWayfireWM:masterfrom
Draft
Make focusing newly mapped views optional (strict focus stealing prevention)#2627dkondor wants to merge 10 commits intoWayfireWM:masterfrom
dkondor wants to merge 10 commits intoWayfireWM:masterfrom
Conversation
Contributor
|
I think it's easier with python and a few lines: |
Member
While this is a good workaround in practice, we still switch the focus and then back. Depending on the app, this might not be what we want. |
…sponding option is not set
This is necessary as some apps will send the "activate" request before their view is mapped.
…dd environment variables
…run by Wayfire This is required for them to activate if focusing newly mapped views by default is disabled.
Dialogs are identified as a view with a parent. This commit also moves shared code between xdg-shell and xwayland to a common location (toplevel_view_interface_t::focus_toplevel_on_map())
a1c9ec1 to
418b745
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also continuation of #2527 and #2626, creating a (mostly) complete solution for focus stealing prevention.
This adds an option (
core/focus_on_map) that determines whether newly mapped (opened) views are focused. The default istruewhich keeps the current behavior (as I imagine the newly introduced behavior would be too restrictive for most users). When set to false, views must explicitly use the xdg-activation protocol to gain focus, even when first mapped.This PR is organized into 4 parts:
This is currently a draft, since some functionality is still missing:
core. it would be nice to collect all focus stealing / activation related options in one place (i.e. with xdg-activation); however, since this option needs to be accessed from core, I don't like the idea of putting it under a plugin. Maybe an alternative would be introducing one more signal, but that also sounds overkill.