Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dont-steal-focus configuration property. #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sarg
Copy link

@sarg sarg commented Oct 15, 2024

Some applications send _NET_ACTIVE_WINDOW to activate their window. EXWM respects this message always and brings such up into focus. This might be unintended and there should be a way to turn this off. In my case the app is Spotify desktop client installed from Flatpak.

Fixes ch11ng/exwm#732

@walseb
Copy link
Contributor

walseb commented Oct 15, 2024

Great PR, I have been disabling this piece of code for months with no issues.

I believe without it removed steam is very annoying to use because it constantly calls the focus steal event.

Probably it should be configurable which events emacs should listen to. Or each event could have a list of hooks so you can run functions whenever an event is fired, or remove functions from that list.

Copy link
Contributor

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable with a few nits.

But I have to ask the annoying question: have you signed your FSF paperwork for Emacs? EXWM is considered a part of Emacs for copyright purposes. This kind of change is probably minor enough that we can call it "copyright exempt", but it would be good to know for future reference.

@@ -98,6 +98,7 @@ want to match against EXWM internal variables such as `exwm-title',
(alist :key-type (key-sequence :tag "From")
:value-type (key-sequence :tag "To")))
((const :tag "Workspace" workspace) integer)
((const :tag "Don't steal focus" dont-steal-focus) boolean)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document above please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

exwm.el Outdated Show resolved Hide resolved
exwm-manage.el Outdated
@@ -65,6 +65,7 @@ possible choices:
* prefix-keys: `exwm-input-prefix-keys' local to this X window.
* simulation-keys: `exwm-input-simulation-keys' local to this X window.
* workspace: The initial workspace.
* dont-steal-focus: Ignore _NET_ACTIVE_WINDOW signal from this X window.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "Ignore focus/raise requests from this X window." Avoids users having to know what "_NET_ACTIVE_WINDOW" means.

But now I'm in the "super nits" territory so I'm happy with leaving it as-is if you find it more clear that way.

Copy link
Author

@sarg sarg Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's use the wording of official documentation: https://specifications.freedesktop.org/wm-spec/1.3/ar01s03.html#id-1.4.10

@sarg
Copy link
Author

sarg commented Oct 15, 2024

I haven't assigned the copyright yet. I've contributed a small patch to emacs some years ago, combined with this one it gives more than 15 changed lines. Does that mean I must do the paperwork now?

@Stebalien
Copy link
Contributor

If possible. If not, 15 isn't some magic number codified in law so I don't think it'll be real issue.

But I'm guessing you'll continue submitting small patches. In that case, it would be better to just get the copyright paperwork out of the way (it's a reasonably painless unless the company you work for tries to claim ownership of everything you do outside of working hours).

@minad
Copy link
Member

minad commented Oct 15, 2024

As far as I know, the small patch limit can somehow add up, leading to something non-trivial in the end, maybe even across parts of the overall GNU/Emacs project. It depends on who you ask. But to be strictly legally safe it is better to go with the copyright assignment.

Some applications send _NET_ACTIVE_WINDOW to activate their window. EXWM
respects this message always and brings such up into focus. This might
be unintended and there should be a way to turn this off. In my case the
app is Spotify desktop client installed from Flatpak.

Fixes ch11ng/exwm#732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prevent an application from stealing focus
4 participants