Skip to content

Conversation

@ash-impl
Copy link

closes #661

@github-project-automation github-project-automation bot moved this to 📬 Needs triage in glazewm Jun 24, 2025
@ash-impl ash-impl force-pushed the fix/display_scaling_issues branch from ab50e92 to 7db5edb Compare June 24, 2025 23:27
@ash-impl ash-impl marked this pull request as draft June 24, 2025 23:57
@ash-impl
Copy link
Author

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
Before Fix
Screenshot 2025-06-25 072938
After Fix
Screenshot 2025-06-25 073245WithFix

Problem 2 as stated in #661
Before Fix
Screenshot 2025-06-25 072746
After Fix
Screenshot 2025-06-25 073141WithFix

@ash-impl ash-impl marked this pull request as ready for review June 25, 2025 11:43
Comment on lines 270 to 274
if window.is_tiling_window() {
if let Some(workspace) = window.workspace() {
rect = rect.constrain_within(&workspace.to_rect()?);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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 👍

/// 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 {
Copy link
Member

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

@lars-berger
Copy link
Member

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)?

@ash-impl
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📬 Needs triage

Development

Successfully merging this pull request may close these issues.

[Bug] Display scaling causes wrong window size

2 participants