Skip to content
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: Use exact scale factor #9440

Closed

Conversation

kazatsuyu
Copy link
Contributor

@kazatsuyu kazatsuyu commented Mar 16, 2024

Maybe several problem in this will be solved by #9438, I wait it.

Also below is remained task.

  • Positions that be stored in database should be multiplyed by scale_factor

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 16, 2024
@JunkuiZhang
Copy link
Contributor

JunkuiZhang commented Mar 16, 2024

Edit: Sorry, I misread that. I'm not sure if the current issues related to the scale factor are on the blade side or if they are implementation issues within the Windows gpui platform.

@kazatsuyu
Copy link
Contributor Author

Probably blade requires the number of physical pixels, so in HiDpi mode, we should just use the value notified by Windows.

There seems to be differences between macOS and Windows in the effect of the scale factor on the size of the window, so there needs to be some changes.

@kazatsuyu
Copy link
Contributor Author

In second thought, the values to be stored in the database can remain the same. And apply display scale factor on create window.
So I have to wait #9360 too

@kazatsuyu
Copy link
Contributor Author

https://learn.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-getdpiformonitor#remarks
Apparently it is better to use GetDpiForWindow instead of checking the dpi of the monitor, so it would be better to create the window and then use SetWindowPos to move it.

@kazatsuyu kazatsuyu force-pushed the windows-scale-factor branch from f396c55 to 3589ed6 Compare March 16, 2024 16:33
@maxdeviant maxdeviant changed the title Windows: Use exact scale factor windows: Use exact scale factor Mar 18, 2024
mikayla-maki pushed a commit that referenced this pull request Mar 20, 2024
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
@kazatsuyu
Copy link
Contributor Author

Close because of #9449 #9456 is merged

@kazatsuyu kazatsuyu closed this Mar 20, 2024
pjlast pushed a commit to pjlast/zed that referenced this pull request Mar 26, 2024
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
@kazatsuyu kazatsuyu deleted the windows-scale-factor branch March 27, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants