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

Fix: Hyprland/Workspaces workspaces not being created as persistent when they already exist at startup #2605

Conversation

Syndelis
Copy link
Contributor

@Syndelis Syndelis commented Oct 24, 2023

Fixes #2597

About this PR

This PR guarantees persistent workspace rules will be applied even if the workspaces already exists at bar startup.

Previously, persistent workspaces would always be created before regular workspaces. #2578 changed that in order to guarantee workspaces were created with their respective windows.

However, this meant that pre-existing would-be-persistent workspaces were being created by another function, one which did not account for the persistent configuration.

The changes in this PR makes it so that the Workspaces::create_workspace method checks if a workspace with the same name already exists and, if so, sets the workspace as persistent depending on the payload, rather than attempting to create a new one.

@Syndelis Syndelis changed the title Revert "fix: set existing workspaces as persistent on startup" Fix: Hyprland/Workspaces workspaces not being created as persistent when they already exist at startup Oct 24, 2023
@Alexays Alexays merged commit a459d8a into Alexays:master Oct 24, 2023
7 of 8 checks passed
@Syndelis Syndelis deleted the fix/hyprland-persistent-workspaces-disappear-when-empty branch October 24, 2023 11:13
Comment on lines +490 to +492
if (workspace_data["persistent"].asBool() and !(*workspace)->is_persistent()) {
(*workspace)->set_persistent();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can change these 3 lines to just (*workspace)->set_persistent(workspace_data["persistent"].asBool()), right?

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.

[Bug] first entered workspace doesn't follow persistent_workspace rule in Hyprland after eefd6e8
3 participants