-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
windows: Fix incorrect titlebar behavior with a scale factor greater than 1.0 #9438
Conversation
@@ -1593,3 +1596,4 @@ fn oemkey_vkcode_to_string(code: u16) -> Option<String> { | |||
|
|||
// https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-dragqueryfilew | |||
const DRAGDROP_GET_FILES_COUNT: u32 = 0xFFFFFFFF; | |||
const DEFAULT_DPI_VALUE: u32 = 96; |
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.
We can use USER_DEFAULT_SCREEN_DPI
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.
Thanks!
let frame_y = unsafe { GetSystemMetricsForDpi(SM_CYFRAME, dpi) }; | ||
let padding = unsafe { GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi) }; | ||
// let dpi = unsafe { GetDpiForWindow(self.hwnd) }; | ||
let frame_x = unsafe { GetSystemMetricsForDpi(SM_CXFRAME, USER_DEFAULT_SCREEN_DPI) }; |
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.
I don't think we need to go to using USER_DEFAULT_SCREEN_API
here and instead use these values in the platform titlebar which are existing TODOs
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.
done here. #9449
@JunkuiZhang give it a try!
Should be addressed by #9456 |
screenshots and description incoming ## title bar when window is maximized | before | after | | --- | --- | | ![image](https://github.com/zed-industries/zed/assets/1284289/075a943d-54db-4b71-9fa0-15f823255182) | ![image](https://github.com/zed-industries/zed/assets/1284289/39a1d381-fcfd-4651-aab4-231a8ec3bd99) | ## ~~caption buttons at 200%~~ ~~buttons are now properly responsive at different scales~~ ~~closes #9438~~ ~~proper scale factor handling in follow up PR (possibly #9440)~~ <details> <summary>out of date image</summary> ![scale-factor](https://github.com/zed-industries/zed/assets/1284289/299d37b8-0d2e-4f2e-81db-2fff6fc59a62) </details> should be fixed by #9456 Release Notes: - N/A
screenshots and description incoming ## title bar when window is maximized | before | after | | --- | --- | | ![image](https://github.com/zed-industries/zed/assets/1284289/075a943d-54db-4b71-9fa0-15f823255182) | ![image](https://github.com/zed-industries/zed/assets/1284289/39a1d381-fcfd-4651-aab4-231a8ec3bd99) | ## ~~caption buttons at 200%~~ ~~buttons are now properly responsive at different scales~~ ~~closes zed-industries#9438~~ ~~proper scale factor handling in follow up PR (possibly zed-industries#9440)~~ <details> <summary>out of date image</summary> ![scale-factor](https://github.com/zed-industries/zed/assets/1284289/299d37b8-0d2e-4f2e-81db-2fff6fc59a62) </details> should be fixed by zed-industries#9456 Release Notes: - N/A
Fixed the issue where the titlebar functionality was not working correctly when the scale factor was greater than 1.0.
As I mentioned in #8809 , support for scale factors greater than 1.0 will require more efforts on the
blade
side.Titlebar incorrect behaviour (with scale factor 1.5):
8.mp4
Release Notes: