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
{{ message }}
Repository navigation
Resize window area is 1 pixel in top right of screen #185249
bugIssue identified by VS Code Team member as probable bugelectronIssues and items related to ElectrontitlebarVS Code main title bar issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)upstream-issue-linkedThis is an upstream issue that has been reported upstreamwindowsVS Code on Windows issues
I've noticed I naturally resize windows in the top right almost always, it's very difficult in VS Code as the hit area is a single pixel on Windows with the custom title bar.
I would like to solve this problem, It will be my first open source contributi
on for this repository.
Do you mind if I start? but i dont know much i just fork on git hub that alll
The resize area issue occurs when creating an Electron BrowserWindow with the frame property set to false. There is another property for BrowserWindow called thickFrame. The resize area issue is not fixed after setting thickFrame to true; it seems that the correct behaviour only occurs when frame itself is set to true.
Changing numeric frame-related constant values throughout the code doesn't seem to fix the issue. Commenting out !has_frame() if-statements does not fix the issue, either.
I created a minimal WinAPI window example in Visual Studio and realized that the WS_THICKFRAME window style allows us to get the resizing area behaviour we want. I have also confirmed that that style does not automatically add a full caption to a window.
I also confirmed with Spy++ that setting thickFrame to true while keeping frame set to false for an Electron BrowserWindow results in a window that does not have the WS_THICKFRAME style, which seems to explain why the resizing area differs between framed and frameless BrowserWindows in Electron, even when thickFrame is set to true.
Edit: Spy++ suggests that Edge and Explorer don't have WS_THICKFRAME either, yet those windows resize properly. I'll have to try out more styles later because I still think the issue has something to do with windows styles.
There is another property for BrowserWindow called thickFrame. The resize area issue is not fixed after setting thickFrame to true; it seems that the correct behaviour only occurs when frame itself is set to true.
ThickFrame option is true by default for frameless windows.
I also confirmed with Spy++ that setting thickFrame to true while keeping frame set to false for an Electron BrowserWindow results in a window that does not have the WS_THICKFRAME style
I just realized that I've been using Spy++ incorrectly. Instead of placing the window finder crosshairs on the titlebar, I have been placing it on the "content window". As a result, WS_THICKFRAME never seemed to be showing up in the styles list.
I have confirmed that framed Electron applications as well as framed native applications such as Notepad and Paint have WS_THICKFRAME styles.
With Electron Fiddle, I made a minimal frameless Electron window with thickFrame set to true, but there was no titlebar to place Spy++ on. I placed the crosshairs in the "content window", and WS_THICKFRAME did not show up in the styles list. I also placed the crosshairs on the VS Code Insiders custom titlebar, and WS_THICKFRAME still did not show up. I have not tried setting thickFrame to true for VS Code.
Edit: I noticed I can just search through the list of windows that Spy++ sees in order to find the outer frame for VS Code windows. I have confirmed that that frame contains the WS_THICKFRAME style. I also confirmed that Electron has the same styles as well. Therefore, both windows are frameless windows with WS_THICKFRAME already.
bugIssue identified by VS Code Team member as probable bugelectronIssues and items related to ElectrontitlebarVS Code main title bar issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)upstream-issue-linkedThis is an upstream issue that has been reported upstreamwindowsVS Code on Windows issues
Activity
sbatten commentedon Aug 28, 2023
Robo (@deepak1556) the horizontal pixels left by WCO is not enough
Krytan commentedon Sep 1, 2023
Robo (@deepak1556) I would like to solve this problem, It will be my first open source contribution for this repository.
Do you mind if I start?
deepak1556 commentedon Sep 4, 2023
Luan (@Krytan) thanks for your interest, first step would be to check if the issue repros in PWA application using the titlebar overlay feature
mkos11 commentedon Oct 8, 2023
I would like to solve this problem, It will be my first open source contributi
on for this repository.
Do you mind if I start? but i dont know much i just fork on git hub that alll
MrJithil commentedon Nov 6, 2023
Can I work on it?
CC: Mrunal Waykos (@mkos11)
Krytan commentedon Nov 6, 2023
MrJithil commentedon Nov 6, 2023
Thank you . Will wait for others shown interests to avoid the duplicate effort.
20 remaining items
rzhao271 commentedon Dec 20, 2023
Hi Han Lin (@hotdogee), it turns out I misunderstood your diagram.
It looks like your fix does fix the resize boundary issue, making my earlier question in #185249 (comment) redundant.
Feel free to submit a PR to the https://github.com/electron/electron repository when you're ready.
Thanks!
rzhao271 commentedon Jan 16, 2024
Hi Han Lin (@hotdogee), when you're ready, could you put up a PR for your fix?
rzhao271 commentedon Jan 23, 2024
Current findings
The resize area issue occurs when creating an Electron BrowserWindow with the
frameproperty set tofalse. There is another property for BrowserWindow calledthickFrame. The resize area issue is not fixed after settingthickFrametotrue; it seems that the correct behaviour only occurs whenframeitself is set totrue.Changing numeric frame-related constant values throughout the code doesn't seem to fix the issue. Commenting out
!has_frame()if-statements does not fix the issue, either.I created a minimal WinAPI window example in Visual Studio and realized that the
WS_THICKFRAMEwindow style allows us to get the resizing area behaviour we want. I have also confirmed that that style does not automatically add a full caption to a window.I also confirmed with Spy++ that setting
thickFrametotruewhile keepingframeset tofalsefor an Electron BrowserWindow results in a window that does not have theWS_THICKFRAMEstyle, which seems to explain why the resizing area differs between framed and frameless BrowserWindows in Electron, even whenthickFrameis set totrue.Edit: Spy++ suggests that Edge and Explorer don't have
WS_THICKFRAMEeither, yet those windows resize properly. I'll have to try out more styles later because I still think the issue has something to do with windows styles.deepak1556 commentedon Jan 23, 2024
ThickFrame option is
trueby default for frameless windows.Hmm this contradicts https://github.com/electron/electron/blob/1300e83884595a3c89c24bd4d42f3a1bbbb6fe7d/shell/browser/native_window_views.cc#L365-L379, would be a bug if that style is not applied as the runtime expects it to be.
rzhao271 commentedon Jan 30, 2024
I just realized that I've been using Spy++ incorrectly. Instead of placing the window finder crosshairs on the titlebar, I have been placing it on the "content window". As a result, WS_THICKFRAME never seemed to be showing up in the styles list.
I have confirmed that framed Electron applications as well as framed native applications such as Notepad and Paint have WS_THICKFRAME styles.
With Electron Fiddle, I made a minimal frameless Electron window with thickFrame set to true, but there was no titlebar to place Spy++ on. I placed the crosshairs in the "content window", and WS_THICKFRAME did not show up in the styles list. I also placed the crosshairs on the VS Code Insiders custom titlebar, and WS_THICKFRAME still did not show up. I have not tried setting thickFrame to true for VS Code.
Edit: I noticed I can just search through the list of windows that Spy++ sees in order to find the outer frame for VS Code windows. I have confirmed that that frame contains the WS_THICKFRAME style. I also confirmed that Electron has the same styles as well. Therefore, both windows are frameless windows with WS_THICKFRAME already.
fix: extend resize hit area for frameless windows
fix: extend resize hit area for frameless windows
fix: extend resize hit area for frameless windows