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

window rules opening windows on wrong monitors #124

Open
Mara-Dawn opened this issue Aug 29, 2024 · 1 comment
Open

window rules opening windows on wrong monitors #124

Mara-Dawn opened this issue Aug 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Mara-Dawn
Copy link

Mara-Dawn commented Aug 29, 2024

I have a 3 monitor setup with the following plugin config:

plugin {
    split-monitor-workspaces {
        count = 10
        keep_focused = 0
        enable_notifications = 0
        enable_persistent_workspaces = 0
    }
}

windowrule = workspace 2,^(thunderbird)$

Workspaces 1-10 are assigned to my right monitor, 11-20 to my left one and 21-30 to my center one.
If i am currently on my center monitor and open thunderbird with rofi, it does get sent to a workspace with the name "2", but the workspace will be on my center monitor instead of on my right one.

Expected behavior would be that the workspace number 2 will also spawn on the right monitor since it was assigned to that screen by the plugin.

If i enable persistent workspaces everything works as expected.

I can provide more info if needed / test other things.

@zjeffer zjeffer added the bug Something isn't working label Aug 31, 2024
@zjeffer
Copy link
Collaborator

zjeffer commented Sep 1, 2024

I'm not sure yet how we can fix this. When the enable_persistent_workspaces option is disabled, we don't really bind workspaces to monitors at all. When it's enabled, we create the persistent ones on the monitor it should be mapped to, and mark the workspace as persistent.

Currently, when creating a workspace, Hyprland checks its config file to see if the workspace is bound to a monitor, and if so it'll create the workspaces on that monitor and make it persistent. I don't think there's a way for us to get in between that process, unless we change the Hyprland config when the plugin maps the monitors. We'd need some way to bind workspaces to monitors through the plugin system without changing the configuration.

We used to write the persistent workspace rules to a file in /tmp, which the user could source in their Hyprland config (#52), but this was a really ugly solution (that also breaks dynamic configuration with hyprctl) and was improved by @toamz in #111. Now we dynamically make the workspaces themselves persistent, without changing the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants