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

[Bug] Alt+tab being assigned even when not assigned in jwmrc #543

Closed
keshto opened this issue Jan 31, 2022 · 8 comments
Closed

[Bug] Alt+tab being assigned even when not assigned in jwmrc #543

keshto opened this issue Jan 31, 2022 · 8 comments
Milestone

Comments

@keshto
Copy link
Contributor

keshto commented Jan 31, 2022

This is on a Debian packaged jwm (might be different other places?).
My jwmrc has no binding for alt+tab and would like to use that keybinding to use https://github.com/sagb/alttab while we wait on #334. However, when running alttab, I get:
alttab: Error while (un)grabbing key 0x17 with mask 0x8/0x12. Probably other program already grabbed this combination. Check: xdotool keydown alt+Tab; xdotool key XF86LogGrabInfo; xdotool keyup Tab; sleep 1; xdotool keyup alt and then look for active device grabs in /var/log/Xorg.0.log ...
One can see that indeed jwm is using this keybinding although not assigned.

@keshto keshto changed the title [Bug] Alt+tab being assigned even when assigned [Bug] Alt+tab being assigned even when not assigned in jwmrc Jan 31, 2022
@joewing
Copy link
Owner

joewing commented Feb 3, 2022

The reason for this behavior is that JWM assigns alt-tab by default, though it probably should not. The offending line is here:
https://github.com/joewing/jwm/blob/master/src/default.c#L20

@joewing joewing added this to the Version 2.4.1 milestone Feb 3, 2022
@keshto
Copy link
Contributor Author

keshto commented Feb 3, 2022

I think that is a sane default. However, if there is a .jwmrc (user defined) and it is not set then don't apply any of the defaults.

@joewing
Copy link
Owner

joewing commented Feb 12, 2022

The defaults that are built into JWM are really intended as a failsafe in case you don't have a configuration file. The example configuration already includes these bindings. So I removed them from the code.

@keshto
Copy link
Contributor Author

keshto commented Feb 12, 2022

Makes sense. Could we do a "if no config file use defaults else expect user to know what they doing"?

It sorta surprising when one don't have a keybinding and that combination is taken, especially by something that is configurable and defined in config file.

Will give the changes a run. Seems like it just close and switch windows you removed opposed to above logic which should be fine for my use case, but I see in future maybe the other defiant keybinding that are defined differently in someone's config will went to be used.

Thanks again!

@joewing
Copy link
Owner

joewing commented Feb 12, 2022

Well, that's pretty much what it does now unless I'm missing something.

@keshto
Copy link
Contributor Author

keshto commented Feb 12, 2022 via email

@joewing
Copy link
Owner

joewing commented Feb 12, 2022

The alt bindings are special because JWM needs to grab them on all windows. Those other bindings are only grabbed when a menu is shown, etc. So they shouldn't interfere with anything, though I could remove them too if they cause problems somehow.
The mouse bindings are essentially what was there before mouse bindings were a thing in 2.4, so I suspect they won't cause any surprises unless they aren't there... and in that case it would be quite surprising for the mouse to not work after an upgrade (I suspect many bug reports would follow).

@keshto
Copy link
Contributor Author

keshto commented Feb 12, 2022

Thanks for the context. Will close this one out. I think the commit you made should solve it. Will check, and reopen if it is still an issue.

@keshto keshto closed this as completed Feb 12, 2022
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

No branches or pull requests

2 participants