linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.53k stars 568 forks source link

Fixed window creation position at high-dpi screen #2286

Closed Steve-xmh closed 1 year ago

Steve-xmh commented 1 year ago

Fixed windows position at high-dpi screen when creating window.

Because I've just noticed that when I need to make window center on high-dpi screen the window will shift to the upper left corner. I've just checked the code for a while and tried to simply fix it.

xStrom commented 1 year ago

Thank you for your effort!

I haven't looked at the substance of this PR yet, but please do the following:

xStrom commented 1 year ago

Thanks again for tackling this issue. This PR here does address the symptom but as I was looking into the problem I found that we need a deeper fix.

That fix is now available in #2296. In my own testing it solves this issue. Perhaps you could see if it solves it for you too?

Steve-xmh commented 1 year ago

Thanks again for tackling this issue. This PR here does address the symptom but as I was looking into the problem I found that we need a deeper fix.

That fix is now available in #2296. In my own testing it solves this issue. Perhaps you could see if it solves it for you too?

Thanks a lot! Your code also works on my code. So I think I should close this pr for your further modification since my patch is too simple (As I'm new at contributing code at Druid).

Anyway, thanks a lot for your work on this simple patch!