Skip to content

border issue with Windows 10 #51540

Open
Open

Description

@yuzw1007

Preflight Checklist

Electron Version

41.2.1

What operating system(s) are you using?

Windows

Operating System Version

版本 Windows 10 专业版 版本号 22H2 安装日期 ‎2023/‎11/‎17 OS 内部版本 19045.6466

What arch are you using?

x64

Last Known Working Electron version

41.2.0

Does the issue also appear in Chromium / Google Chrome?

I don't know how to test

Expected Behavior

Starting with version 41.2.1, the left, right, and bottom borders of the window will have a dark gray border line, while the top border will not have a dark gray border line. This issue did not exist in previous versions.

Image

上面这种图是41.2.0版本,windows 10上面正常显示,边框没有黑线。

Actual Behavior

Image

This image shows the black lines appearing on Windows 10 after upgrading to version 41.2.1 or later. There are no black lines on the top border; only the left, right, and bottom borders have black lines. The effect is not visible on Windows 11; the black lines are only visible on Windows 10.

Operating system information:

Processor: 11th Gen Intel(R) Core(TM) i5-1155G7 @ 2.50GHz; 2.50 GHz
RAM: 24.0 GB (23.8 GB available);
Storage: 954 GB SSD; UMIS RPITJ1TBVME2HWD;
Graphics: Intel(R) Iris(R) Xe Graphics (128 MB)

System type: 64-bit operating system, x64-based processor

Version: Windows 10 Professional
Version Number: 22H2
Installation Date: 2023/11/17
OS Build Number: 19045.6466

Testcase Gist URL

https://github.com/yuzw1007/electron-41-border-demo.git

Additional Information

访问github gitst无法打开,单独创建了一个示例repo, 直接运行npm run dev
只有windows 10上面有这个黑线问题,windows 11上面看不出来黑线。

Activity

  1. added theissue type on May 7, 2026
  2. yuzw1007 commented on May 7, 2026

    @yuzw1007
    Author

    我试了下最新的electron 42.0.0版本也是有相同问题(windows 10上面),

  3. nikwen commented on May 7, 2026

    @nikwen
    Member

    Google Translate version.

    Thanks for reporting! This looks like a Windows 10 version of #51456. CC @mitchchn.

    Could you please post your repro as a gist made with Fiddle? For security reasons, maintainers won't run external repositories with third-party dependencies.

    Range: v41.2.0...v41.2.1

  4. added
    bug/regression ↩️
    blocked/need-repro
    on May 7, 2026
  5. electron-issue-triage commented on May 7, 2026

    @electron-issue-triage

    Hello @yuzw1007. Thanks for reporting this and helping to make Electron better!

    Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

    Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

    Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

  6. yuzw1007 commented on May 7, 2026

    @yuzw1007
    Author

    Hello @yuzw1007. Thanks for reporting this and helping to make Electron better!

    Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

    Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

    Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

    gits.github.com 这个地址我这儿访问不了。

  7. removed
    blocked/need-repro
    on May 7, 2026
  8. nikwen commented on May 7, 2026

    @nikwen
    Member

    Understood! In that case, can you create a reproduction in Fiddle, save it via File > Save, and upload the resulting folder as a GitHub repository? Then we'll have a simple reproduction without third-party dependencies.

  9. added
    blocked/need-repro
    on May 7, 2026
  10. nikwen commented on May 7, 2026

    @nikwen
    Member

    Just posting some screenshots from a Windows 10 machine here because @mitchchn requested them.

    Frameless Electron window (default Fiddle with frame: false) next to a frameless non-Electron window:

    Image

    Settings window focused:

    Image

    Settings window not focused:

    Image

    Electron doesn't look like either of them.

    Default fiddle with frame:

    Image

    That one looks native.

    Chrome 146:

    Image
  11. 5 remaining items

  12. mitchchn commented on May 15, 2026

    @mitchchn
    Member

    Thanks @yuzw1007. You are correct about the line of code which causes the top border not to appear on Windows 10.

    However:

    1. It is necessary for Electron to keep a 0-inset at the top of a non-maximized frame on Windows. It did this previously as well.
    2. Prior to 41.2.1, Electron set 0-insets on all sides. This was incorrect on both Windows 10 and 11, where thick frame windows are supposed to have insets on the side and bottom for resizing and capturing input.
    3. The appearance in older versions of Electron was also not correct on Windows 10. Thick frame windows are supposed to show borders on all sides, not just shadows. The borders were just being clipped, unintentionally, by the 0-insets.

    So it is correct for the top and side insets to be different. Windows 11 handles this situation appropriately by drawing a border regardless of insets. Windows 10 does not -- it requires insets to draw the side borders, and uses the native caption to draw the top border.

    Chrome specifically works around this problem by manually drawing a 1 px border at the top of the window in BrowserFrameViewWin::PaintTitlebar: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/chrome/browser/ui/views/frame/browser_frame_view_win.cc#728.

    This is something Electron could also do (or in a simpler way using DWM, per the comment in that code). I'd be happy to look at a PR if I do not get around to it myself.

    However it is a minor graphical problem which existed before (although with a slightly different outcome) and which only affects Windows 10. The trade-off is improved resize behavior in all versions of Windows.

  13. electron-issue-triage commented on Aug 14, 2026

    @electron-issue-triage

    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!

  14. electron-issue-triage commented on Sep 14, 2026

    @electron-issue-triage

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

  15. CN-Tower commented on Nov 13, 2026

    @CN-Tower

    Electron白边的bug没人管吗,我用v45.3.1还是能够复现?没修复的话新版本一直不能用哦,我提的issue在这,#51891
    Electron fiddle的github gist也有:https://gist.github.com/CN-Tower/ca384e1a1545d2bbb9693589de76851a

  16. mlaurencin commented on Nov 16, 2026

    @mlaurencin
    Member

    Reopening as linked duplicate issue should have been noted as activity and resulted in the stale timer being cleared

  17. added
    has-repro-gist
    and removed on Nov 16, 2026
  18. moved this to 👀 Unsorted Items in 45-x-yon Nov 16, 2026
  19. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 45-x-yon Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    41-x-y45-x-ybug 🪲bug/regression ↩️component/BrowserWindowhas-repro-gistplatform/windows

    Type

    Projects

    • Status
      👍 Does Not Block Stable

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions