-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Windows 7 frame showing for frameless non-resizable windows
- Loading branch information
Showing
4 changed files
with
36 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
patches/chromium/fix_remove_caption-removing_style_call.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> | ||
Date: Wed, 17 Aug 2022 13:49:40 -0700 | ||
Subject: fix: Remove caption-removing style call | ||
|
||
There is a SetWindowLong call that removes WS_CAPTION for frameless | ||
windows, but Electron uses WS_CAPTION even for frameless windows. | ||
|
||
Removing this call only affects frameless windows, and it fixes | ||
a visual glitch where they showed a Windows 7 style frame | ||
during startup. | ||
|
||
The if statement was originally introduced by | ||
https://codereview.chromium.org/9372053/, and it was there to fix | ||
a visual glitch with the close button showing up during startup | ||
or resizing, but Electron does not seem to run into that issue | ||
for frameless windows even with that block commented out. | ||
|
||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc | ||
index c6810f162806b36494885b2f63982a756d4dcd38..92d030a3d24a7bb282f698a5591cf33ae14e06ed 100644 | ||
--- a/ui/views/win/hwnd_message_handler.cc | ||
+++ b/ui/views/win/hwnd_message_handler.cc | ||
@@ -1723,12 +1723,6 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { | ||
SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), | ||
0); | ||
|
||
- if (!delegate_->HasFrame()) { | ||
- SetWindowLong(hwnd(), GWL_STYLE, | ||
- GetWindowLong(hwnd(), GWL_STYLE) & ~WS_CAPTION); | ||
- SendFrameChanged(); | ||
- } | ||
- | ||
// Get access to a modifiable copy of the system menu. | ||
GetSystemMenu(hwnd(), false); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters