You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
42.0.0-beta.6
What operating system(s) are you using?
Windows
Operating System Version
Windows 10
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
When a window changes its scaling, the resize handle size should grow/shrink with the scaling.
Window opened with 100% scaling has a resize handle of 8px, when changing the scaling to 150% the resize handle should be 12px
Actual Behavior
Electron only gets the resize handle size initially and does not change it anymore. when changing scale the resize handle size does not update
Testcase Gist URL
No response
Additional Information
Probably related: #50706 const int thickness = ::GetSystemMetrics(SM_CXSIZEFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER);
Should maybe GetSystemMetricsForDpi be used? with the current dpi of the window to support multi display setups
@nikwen Since the resize handle used to be inside the client area I can't easily tell.
I am using a tool called "window inspector" to compare the window rect with the client rect
@nikwen I believe it's actually the other way around, we should be using screen pixels everywhere since DIP will always return the same logical insets. But it's more than just a one-line change (hopefully not too much more). Investigating...
If GetSystemMetricsInDIP always returns the same value (logical), which for 100% scaling would be a sum of 8px, then the change could be as mentioned above and just multiply the result by the window DPI
thickness = (frame + border) * dpi
Maybe something like display::win::GetScreenWin()->GetDpi() exists?
EDIT: should rather be on the window, like window_->has_frame() something like window_->getDpi()
Activity
nikwen commentedon Apr 29, 2026
Good point! Thanks for opening the issue.
Just to confirm, is this a regression or has this never worked?
CC @mitchchn.
t57ser commentedon Apr 29, 2026
@nikwen Since the resize handle used to be inside the client area I can't easily tell.
I am using a tool called "window inspector" to compare the window rect with the client rect
ckerr commentedon Apr 30, 2026
CC @mitchchn
mitchchn commentedon Apr 30, 2026
Could you test Chrome the same way you did for Electron? It would be good to know if this is handled upstream.
nikwen commentedon Apr 30, 2026
@mitchchn Not sure if that matters here to be honest.
I believe @t57ser pointed out the exact line that needs to be fixed:
electron/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc
Lines 109 to 110 in d0612e2
You already introduced the right version in #50706
electron/shell/browser/ui/views/win_frame_view.cc
Lines 287 to 289 in d0612e2
Unless I'm missing something. In that case, please correct me. 🙂
mitchchn commentedon May 4, 2026
@nikwen I believe it's actually the other way around, we should be using screen pixels everywhere since DIP will always return the same logical insets. But it's more than just a one-line change (hopefully not too much more). Investigating...
t57ser commentedon May 4, 2026
I'm not sure what
GetSystemMetricsInDIPis, what I was refering to was this: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemmetricsfordpiIt accepts a dpi value as a second parameter which could be taken from: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiforwindow
If
GetSystemMetricsInDIPalways returns the same value (logical), which for 100% scaling would be a sum of 8px, then the change could be as mentioned above and just multiply the result by the window DPIthickness = (frame + border) * dpiMaybe something like
display::win::GetScreenWin()->GetDpi()exists?EDIT: should rather be on the window, like
window_->has_frame()something likewindow_->getDpi()mitchchn commentedon May 5, 2026
Turns out there was a specific method in Chrome to get the handle size for the current monitor's DPI (which is used in Chrome for this purpose):