electron/patches/chromium/fix_remove_caption-removing_style_call.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
2.4 KiB
Diff
Raw Normal View History

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: Adjust 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,
unless they are transparent.
Changing 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 opaque 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
chore: bump chromium to 138.0.7175.0 (37-x-y) (#47078) * chore: bump chromium in DEPS to 138.0.7166.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 138.0.7166.2 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * 6508373: Add WebContents, Tab getters for future Clank navigation capture rework https://chromium-review.googlesource.com/c/chromium/src/+/6508373 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6470924: Introduce auto-populated Search Engine icons. https://chromium-review.googlesource.com/c/chromium/src/+/6470924 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6502977: Force same tab navigation while actor coordinator is acting on a tab https://chromium-review.googlesource.com/c/chromium/src/+/6502977 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 138.0.7168.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: update patches Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> * fix grit patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump Chromium to 138.0.7169.2 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6493688: NavigationThrottleRunner2: void CreateThrottlesForNavigation https://chromium-review.googlesource.com/c/chromium/src/+/6493688 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6488755: Reland "WebSQL: Remove WebPreference" https://chromium-review.googlesource.com/c/chromium/src/+/6488755 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6428707: FSA: Only normalize the hardcoded rules once during initialization https://chromium-review.googlesource.com/c/chromium/src/+/6428707 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup patch indices Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 138.0.7170.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * 6514121: Remove origin calculation debug info and related methods https://chromium-review.googlesource.com/c/chromium/src/+/6514121 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 138.0.7172.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 138.0.7173.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 138.0.7175.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * fixup! 6514121: Remove origin calculation debug info and related methods Refs https://chromium-review.googlesource.com/c/chromium/src/+/6514121 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * 6531585: Don't retry LayerTreeSink creation on the high priority queue Refs https://chromium-review.googlesource.com/c/chromium/src/+/6531585 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * 6512253: Modernize base::apple's base bundle ID Refs https://chromium-review.googlesource.com/c/chromium/src/+/6512253 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fixup! 6428707: FSA: Only normalize the hardcoded rules once during initialization Refs https://chromium-review.googlesource.com/c/chromium/src/+/6428707 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework Refs https://chromium-review.googlesource.com/c/chromium/src/+/6508373 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * chore: update patches Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * chore: update patches --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-05-14 10:07:45 -04:00
index 6f2e2702d3b982fe7e8d258f303c8055d3d37df8..88f658aeb32a3181e3a0cd45fbd2aacad95116aa 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
chore: bump chromium to 138.0.7175.0 (37-x-y) (#47078) * chore: bump chromium in DEPS to 138.0.7166.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 138.0.7166.2 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * 6508373: Add WebContents, Tab getters for future Clank navigation capture rework https://chromium-review.googlesource.com/c/chromium/src/+/6508373 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6470924: Introduce auto-populated Search Engine icons. https://chromium-review.googlesource.com/c/chromium/src/+/6470924 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6502977: Force same tab navigation while actor coordinator is acting on a tab https://chromium-review.googlesource.com/c/chromium/src/+/6502977 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 138.0.7168.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: update patches Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> * fix grit patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump Chromium to 138.0.7169.2 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6493688: NavigationThrottleRunner2: void CreateThrottlesForNavigation https://chromium-review.googlesource.com/c/chromium/src/+/6493688 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6488755: Reland "WebSQL: Remove WebPreference" https://chromium-review.googlesource.com/c/chromium/src/+/6488755 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 6428707: FSA: Only normalize the hardcoded rules once during initialization https://chromium-review.googlesource.com/c/chromium/src/+/6428707 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup patch indices Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 138.0.7170.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * 6514121: Remove origin calculation debug info and related methods https://chromium-review.googlesource.com/c/chromium/src/+/6514121 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 138.0.7172.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 138.0.7173.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 138.0.7175.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * fixup! 6514121: Remove origin calculation debug info and related methods Refs https://chromium-review.googlesource.com/c/chromium/src/+/6514121 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * 6531585: Don't retry LayerTreeSink creation on the high priority queue Refs https://chromium-review.googlesource.com/c/chromium/src/+/6531585 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * 6512253: Modernize base::apple's base bundle ID Refs https://chromium-review.googlesource.com/c/chromium/src/+/6512253 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fixup! 6428707: FSA: Only normalize the hardcoded rules once during initialization Refs https://chromium-review.googlesource.com/c/chromium/src/+/6428707 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework Refs https://chromium-review.googlesource.com/c/chromium/src/+/6508373 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * chore: update patches Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * chore: update patches --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-05-14 10:07:45 -04:00
@@ -1796,7 +1796,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS),
0);
- if (!delegate_->HasFrame()) {
+ LONG is_popup =
+ GetWindowLong(hwnd(), GWL_STYLE) & static_cast<LONG>(WS_POPUP);
+
+ // For transparent windows, Electron removes the WS_CAPTION style,
+ // so we continue to remove it here. If we didn't, an opaque rectangle
+ // would show up.
+ // For non-transparent windows, Electron keeps the WS_CAPTION style,
+ // so we don't remove it in that case. If we did, a Windows 7 frame
+ // would show up.
+ // We also need this block for frameless popup windows. When the user opens
+ // a dropdown in an Electron app, the internal popup menu from
+ // third_party/blink/renderer/core/html/forms/internal_popup_menu.h
+ // is rendered. That menu is actually an HTML page inside of a frameless popup window.
+ // A new popup window is created every time the user opens the dropdown,
+ // and this code path is run. The code block below runs SendFrameChanged,
+ // which gives the dropdown options the proper layout.
+ if (!delegate_->HasFrame() && (is_translucent_ || is_popup)) {
SetWindowLong(hwnd(), GWL_STYLE,
GetWindowLong(hwnd(), GWL_STYLE) & ~WS_CAPTION);
SendFrameChanged();