Skip to content

input: add warp_on_toggle_special #9945

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

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

VirtCode
Copy link
Contributor

@VirtCode VirtCode commented Apr 6, 2025

Describe your PR, what does it fix/add?

Currently the cursor:warp_on_change_workspace option does only apply to changing normal workspaces and not to toggling special ones. This has been bothering me for quite some time because it seems unintuitive and I would often accidentally switch windows on my special workspace because of it.

This PR also warps the cursor on special workspace toggles when cursor:warp_on_change_workspace is enabled. I think this should be the expected behavior because to me opening a special workspace is also a "change of workspace".

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

I can imagine that some users might prefer the old behaviour (i.e. only warping cursor on normal workspace change). So maybe it would be best to gate this behind an additional config var? I also thought about using a different number for warp_on_change_workspace to enable it for specials too, but that wouldn't really make too much sense because 2 is already used for forcing.

Is it ready for merging, or does it need work?

Yes

@vaxerski
Copy link
Member

vaxerski commented Apr 7, 2025

does this mean the cursor will warp to the center if you toggle special workspace on the current monitor? if so, I'd hate that, so definitely a config var

@VirtCode
Copy link
Contributor Author

VirtCode commented Apr 7, 2025

If there are windows open on the special workspace, then it would warp to the focused window there (so to its center if not using persistent_warps). If there is no window open on it, no warping happens. When closing the special workspace, it would warp back to the window that is focused on the current normal workspace. So yes, if you open and close it, without persistent_warps, the cursor would be warped to the focused window's center.

As for the config var, should I do an entirely separate one (e.g. warp_on_toggle_special) or gate it behind an additional number for warp_on_change_workspace (and if so, which number)?

@vaxerski
Copy link
Member

vaxerski commented Apr 9, 2025

up 2 u

@github-actions github-actions bot added the config label Apr 9, 2025
@VirtCode VirtCode changed the title input: do warp_on_change_workspace on special workspaces input: add warp_on_toggle_special Apr 9, 2025
@VirtCode
Copy link
Contributor Author

VirtCode commented Apr 9, 2025

Okay, have now decided to gate it behind warp_on_toggle_special. It has the same options as toggle_on_change_workspace, i.e. allows being set to 2 to force over no warps.

Also made a wiki mr here hyprwm/hyprland-wiki#1029

@vaxerski vaxerski merged commit d775686 into hyprwm:main Apr 10, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants