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(kwin): Standardize Virtual Desktop IDs in KDE Plasma for Consistent Window Rules Configuration #408

Merged
merged 4 commits into from
Nov 30, 2024

Conversation

sidmoreoss
Copy link
Contributor

In KDE Plasma, virtual desktops are currently assigned unique IDs that are generated automatically and differ across systems and even builds. This random assignment causes issues when attempting to apply configuration rules that rely on specific desktop IDs. For instance, in the windowRules option, the attribute apply.desktops allows users to target specific virtual desktops by ID. If these IDs are random, configurations specifying particular desktops (such as assigning certain applications to designated desktops) will not work consistently across systems.

To ensure predictable and controlled behavior, it’s necessary to standardize these IDs so they follow a stable, easily-referenced naming scheme, such as "Desktop_1", "Desktop_2", …, "Desktop_n"—where n represents the total number of virtual desktops configured. By assigning consistent IDs, configurations in windowRules (such as the example shown below) can reliably apply to the intended desktops.

Example Configuration

{
  description = "Virtual desktop for browsers";
  apply.desktops = "Desktop_1";  # Standardized ID for consistent reference
  match.window-class = {
    value = mkWmClassPattern appGroups.browsers;
    type = "regex";
  };
}

Here, apply.desktops = "Desktop_1" references a virtual desktop by a stable ID, ensuring that window rules consistently apply to the same desktop, even after system rebuilds. This approach would prevent configuration breakages and support more granular and stable control over window placements across virtual desktops.

@sidmoreoss sidmoreoss changed the title Standardize Virtual Desktop IDs in KDE Plasma for Consistent Window Rules Configuration fix(kwin): Standardize Virtual Desktop IDs in KDE Plasma for Consistent Window Rules Configuration Nov 3, 2024
@HeitorAugustoLN
Copy link
Member

Didn't test it yet, but if it works as expected, I think it is fine to merge it. I will test it out as soon as possible

@bkchr
Copy link

bkchr commented Nov 29, 2024

@HeitorAugustoLN this pull requests works for me locally, would be nice if this could be merged.

@HeitorAugustoLN

This comment was marked as resolved.

@HeitorAugustoLN
Copy link
Member

Oops nevermind, that was my bad lol

@HeitorAugustoLN HeitorAugustoLN merged commit 02350cd into nix-community:trunk Nov 30, 2024
1 check passed
@HeitorAugustoLN
Copy link
Member

Thanks for your contribution! Pretty good changes :)

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.

3 participants