Skip to content

Resize window area is 1 pixel in top right of screen #185249

Open

Description

@Tyriar

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.

image

Activity

  1. added
    windows
    on Jun 15, 2023
  2. sbatten commented on Aug 28, 2023

    @sbatten
    Member

    Robo (@deepak1556) the horizontal pixels left by WCO is not enough

  3. added
    upstream
    good first issue
    electron
    upstream-issue-pending
    on Aug 29, 2023
  4. Krytan commented on Sep 1, 2023

    @Krytan

    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?

  5. deepak1556 commented on Sep 4, 2023

    @deepak1556
    Collaborator

    Luan (@Krytan) thanks for your interest, first step would be to check if the issue repros in PWA application using the titlebar overlay feature

  6. mkos11 commented on Oct 8, 2023

    @mkos11

    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

  7. MrJithil commented on Nov 6, 2023

    @MrJithil
    Contributor

    Can I work on it?
    CC: Mrunal Waykos (@mkos11)

  8. Krytan commented on Nov 6, 2023

    @Krytan
  9. MrJithil commented on Nov 6, 2023

    @MrJithil
    Contributor

    Thank you . Will wait for others shown interests to avoid the duplicate effort.

  10. 20 remaining items

  11. rzhao271 commented on Dec 20, 2023

    @rzhao271
    Collaborator

    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!

  12. rzhao271 commented on Jan 16, 2024

    @rzhao271
    Collaborator

    Hi Han Lin (@hotdogee), when you're ready, could you put up a PR for your fix?

  13. rzhao271 commented on Jan 23, 2024

    @rzhao271
    Collaborator

    Current findings

    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.

  14. deepak1556 commented on Jan 23, 2024

    @deepak1556
    Collaborator

    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

    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.

  15. modified the milestones: , February 2024 on Jan 24, 2024
  16. rzhao271 commented on Jan 30, 2024

    @rzhao271
    Collaborator

    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.

  17. removed this from the On Deck milestone on Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugelectrontitlebarupstreamupstream-issue-linkedwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions