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 cursor appears too quickly on right edge when frame: false #27247
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
Electron Version:
11.1.1
Operating System:
Windows 10
Last Known Working Electron version:
N/A
Expected Behavior
A user usually has to move their cursor very close to the right edge of the window in order for their cursor to change to a resize cursor.
Even when frame: false, this should be the case.
Actual Behavior
In reality, the cursor becomes a resize cursor when the user has moved their cursor to around 25% of the scrollbar width from the right edge of the window.
Any progress on this? I have about a 5px margin around my entire app where the cursor events dont get passed to my app. Wasnt an issue until I needed a scroll bar and then it became apparent this was happening. I have a frameless window thats not resizable, running on Windows 10. I'm seeing exactly what OP had in the animated examples.
I find it pretty funny how the margin set turns out to be exactly 5px.
Changing the value to a non-positive integer didn't work, and changing the value to 1 fixed the issue of the resize cursor appearing too quickly, but it also made resizing the window when I actually wanted to resize it much harder. I think what is happening, is that as soon as the cursor leaves the window, the resize cursor disappears, whereas with the with-frame window, even when the cursor leaves what appears to be the window, there is actually still a slight margin where the resize cursor still shows. I think that difference is why there is this extra margin added to the frameless window, but I'm not sure how one would go about fixing this.
Interesting find. Yeah, looking at other apps the resize cursor should appear only on the outside of the window for about 10px (basically the size of the shadow). Changing to a non frameless window works in that way. Does there appear to be an outer window padding at all?
Your attempt to fix the issue would fix it in my particular scenario. My frameless window is set to non resizable so the issue of being hard to resize wouldnt matter. A possible fix for that scenario would be to set it to 1 if resizable is set to false. It probably would be better to figure out how to make the resizable area larger though and remove the inner margin to fix it in all cases.
I haven't dove into the code for this very deep yet, but my initial though is there is a window mask, maybe that needs to be bigger by 5px so that the window is actually slightly larger than the real window? Not sure if that is what the mask is for but thats just my initial thought.
@zcbenz I noticed you wrote the code related to the frameless window, and I also know it's been several years since that initial implementation, but I'm wondering if you have any code pointers or thoughts on this issue?
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
I'll reopen this issue in a bit because we've yet another downstream issue that has to do with the incongruency between frameless and non-frameless windows in Electron.
Activity
joezappie commentedon Feb 19, 2021
Any progress on this? I have about a 5px margin around my entire app where the cursor events dont get passed to my app. Wasnt an issue until I needed a scroll bar and then it became apparent this was happening. I have a frameless window thats not resizable, running on Windows 10. I'm seeing exactly what OP had in the animated examples.
rzhao271 commentedon Feb 19, 2021
Now that I got my local clone of the repo set up a bit more properly, I searched through the code a bit and found the following line:
https://github.com/electron/electron/blob/master/shell/browser/ui/views/frameless_view.cc#L18
which is used here
https://github.com/electron/electron/blob/master/shell/browser/ui/views/frameless_view.cc#L35
and the
GetHTComponentForFramepart refers to https://source.chromium.org/chromium/chromium/src/+/master:ui/views/window/non_client_view.cc;l=45?q=non_client_view&ss=chromiumI find it pretty funny how the margin set turns out to be exactly 5px.
Changing the value to a non-positive integer didn't work, and changing the value to
1fixed the issue of the resize cursor appearing too quickly, but it also made resizing the window when I actually wanted to resize it much harder. I think what is happening, is that as soon as the cursor leaves the window, the resize cursor disappears, whereas with the with-frame window, even when the cursor leaves what appears to be the window, there is actually still a slight margin where the resize cursor still shows. I think that difference is why there is this extra margin added to the frameless window, but I'm not sure how one would go about fixing this.joezappie commentedon Feb 19, 2021
Interesting find. Yeah, looking at other apps the resize cursor should appear only on the outside of the window for about 10px (basically the size of the shadow). Changing to a non frameless window works in that way. Does there appear to be an outer window padding at all?
Your attempt to fix the issue would fix it in my particular scenario. My frameless window is set to non resizable so the issue of being hard to resize wouldnt matter. A possible fix for that scenario would be to set it to 1 if resizable is set to false. It probably would be better to figure out how to make the resizable area larger though and remove the inner margin to fix it in all cases.
joezappie commentedon Feb 19, 2021
I haven't dove into the code for this very deep yet, but my initial though is there is a window mask, maybe that needs to be bigger by 5px so that the window is actually slightly larger than the real window? Not sure if that is what the mask is for but thats just my initial thought.
rzhao271 commentedon Mar 1, 2021
@zcbenz I noticed you wrote the code related to the frameless window, and I also know it's been several years since that initial implementation, but I'm wondering if you have any code pointers or thoughts on this issue?
asd281533890 commentedon Jul 7, 2022
I solved this problem in a less elegant way. Here is the code:
github-actions commentedon Oct 6, 2022
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
rzhao271 commentedon Oct 7, 2022
Closing as wontfix
rzhao271 commentedon Nov 10, 2023
I'll reopen this issue in a bit because we've yet another downstream issue that has to do with the incongruency between frameless and non-frameless windows in Electron.
Downstream issue: microsoft/vscode#185249
TODO before reopen:
rzhao271 commentedon Nov 10, 2023
Actually, I'll create a new issue because the context is a bit different now.