Summary: | Window cascades if *any* window would be covered up by it, not just the one below it in the stacking order | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Ennea <s+kde> |
Component: | core | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | matthew.carl.cambria, natalie_clarius, nate |
Priority: | NOR | ||
Version: | 5.27.0 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/commit/39cea49a8fac55beae6d3bff51814b81ec34df87 | Version Fixed In: | 6.0 |
Description
Ennea
2023-02-20 11:06:05 UTC
Makes sense to me. I'd like to second the issue raised in the original post's additional information section. I think I'm in the minority, but I preferred the original behavior where new windows just stacked on top of each other and did not cascade. It would be nice to have a switch to turn the cascading off, or at least be able to override it with a rule. (In reply to mccambria from comment #2) > I'd like to second the issue raised in the original post's additional > information section. I think I'm in the minority, but I preferred the > original behavior where new windows just stacked on top of each other and > did not cascade. It would be nice to have a switch to turn the cascading > off, or at least be able to override it with a rule. To get custom window behavior we have scripting functionality in KWin, here is one that does what you want: https://www.reddit.com/r/kde/comments/117oywo/comment/j9d3ewk/?context=3 In any event this is a different feature request; if the above solution is not satisfactory could you file a separate report for that, and explain what the use case is and why a KWin script is not enough? (In reply to Natalie Clarius from comment #3) > (In reply to mccambria from comment #2) > > I'd like to second the issue raised in the original post's additional > > information section. I think I'm in the minority, but I preferred the > > original behavior where new windows just stacked on top of each other and > > did not cascade. It would be nice to have a switch to turn the cascading > > off, or at least be able to override it with a rule. > > To get custom window behavior we have scripting functionality in KWin, here > is one that does what you want: > https://www.reddit.com/r/kde/comments/117oywo/comment/j9d3ewk/?context=3 > > In any event this is a different feature request; if the above solution is > not satisfactory could you file a separate report for that, and explain what > the use case is and why a KWin script is not enough? That worked perfectly! Thank you for pointing out that option. Cool. Let's close this and see if we get more complaints. (In reply to Nate Graham from comment #5) > Cool. Let's close this and see if we get more complaints. Hey Nate, did you close this ticket accidentally? mccambria's issue has been resolved my Natalie's help, but that's not what this ticket was about in the first place :) Oh right. Yeah the initial issue is valid. Re. the original issue, I think the issue is valid but haven't been able to think of a solution that wouldn't be O(n^2) which Vlad said should better be avoided. Could you not get a sorted list of windows, trim any elements behind the topmost maximized window and then run your overlap checks on the remaining windows? This would not properly handle all cases, but I think it handles many of the common cases. Maybe. I'll need to think about this more. (In reply to Ennea from comment #9) > Could you not get a sorted list of windows, trim any elements behind the > topmost maximized window and then run your overlap checks on the remaining > windows? This would not properly handle all cases, but I think it handles > many of the common cases. Maybe. I'll need to think about this more. Yeah, something like that might work well enough for the most prominent cases. The relevant code is at https://invent.kde.org/plasma/kwin/-/blob/master/src/placement.cpp#L593. Feel free to give it a shot! A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3761 Git commit 39cea49a8fac55beae6d3bff51814b81ec34df87 by Vlad Zahorodnii, on behalf of Natalie Clarius. Committed on 08/03/2023 at 19:04. Pushed by vladz into branch 'master'. placement: don't cascade for the sake of windows that are already covered When checking for overlap with other windows when placing a new window and cascading to avoid complete overlap, ignore those windows that are already covered by other windows further on the top anyway. The computation of the covered area is not entirely accurate as it uses the bounding rect rather than the combined rects of the windows, but okay enough for our use case imo. M +16 -4 src/placement.cpp https://invent.kde.org/plasma/kwin/commit/39cea49a8fac55beae6d3bff51814b81ec34df87 |