-
Notifications
You must be signed in to change notification settings - Fork 306
fix: window size on multiple monitors with different scaling #1111
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
base: main
Are you sure you want to change the base?
Conversation
ab50e92 to
7db5edb
Compare
|
Screenshots for the fixes below. Note that these screenshots go across monitors with scaling 125% for left monitor and 100% for my right monitor which is the boundary crossed in these screenshots. For reference-The power icon is the rightmost icon on my YASB status bar on both monitors. Problem 1 as stated in #661 Problem 2 as stated in #661 |
| if window.is_tiling_window() { | ||
| if let Some(workspace) = window.workspace() { | ||
| rect = rect.constrain_within(&workspace.to_rect()?); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if window.is_tiling_window() { | |
| if let Some(workspace) = window.workspace() { | |
| rect = rect.constrain_within(&workspace.to_rect()?); | |
| } | |
| } | |
| if window.is_tiling_window() { | |
| rect = rect.constrain_within(&workspace.to_rect()?); | |
| } |
window's workspace is already in scope 👍
packages/wm-common/src/rect.rs
Outdated
| /// rectangle. Unlike `clamp`, this method adjusts both the position and | ||
| /// size to ensure the rectangle doesn't extend beyond the boundaries. | ||
| #[must_use] | ||
| pub fn constrain_within(&self, outer_rect: &Rect) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be fine to replace the clamp implementation with this, just need to tweak the doc comment. we only have one other use of clamp and there we'd want the same behavior as well
|
thank you for the fix 💜 do the windows in question have a very large shadow borders which then crosses over to the other monitor? i'm still not fully wrapping my head around how the problem occurs in the first place. do these wonky scaled windows take up more % than they should when you have many windows open (even after the PR fix)? |
|
Hi @lars-berger, thank you for your response. I think the issue was more that we were passing 'None' to methods like 'apply_delta' that accepted optional scale factors for different monitors which resulted in incorrect calculations affecting window size accuracy. |




closes #661