-
Notifications
You must be signed in to change notification settings - Fork 318
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 |
|
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. |
|
@ash-impl did some testing on a fresh W11 machine and from what i can tell, we shouldn't be scaling the border gaps. we get the border size by diffing 1) with PR changes (borders are a bit wonky), 2) without changes unfortunately i'm also unable to reproduce the underlying issue (maybe it's only on W10?). monitor 1 is 150% and monitor 2 is 100%, and then i'm moving an admin window (Event Viewer) between the two monitors like in #661. my guess is that the root cause is // window_getters.rs
fn total_border_delta(
&self,
scale_factor: Option<f32>,
) -> anyhow::Result<RectDelta> {
let border_delta = self.border_delta();
let shadow_border_delta = self.native().shadow_border_delta()?;
tracing::info!("{:?}", border_delta);
tracing::info!("{:?}", shadow_border_delta);
// ...
}could you also see if it makes a difference to refresh border delta prior to redrawing? // platform_sync.rs
window.native().refresh_border_position()?; // add this
let rect = window
.to_rect()?
.apply_delta(&window.total_border_delta()?, None); // leave the rect calculation as-is |
|
Hi @lars-berger thank you for your response. I have since switched to using a single monitor only thanks to your great work on this application and then workplace upgraded to W11 (where I'm not sure this issue persists because of single monitor use). I can test with your recommendations of logging, and work on this more in a couple weeks if it's still an issue (On W10 or W11). |







closes #661