electron/patches/chromium/fix_activate_background_material_on_windows.patch

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

69 lines
2.8 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: clavin <clavin@electronjs.org>
Date: Mon, 11 Dec 2023 20:43:34 -0300
Subject: fix: activate background material on windows
This patch adds a condition to the HWND message handler to allow windows
with translucent background materials to become activated.
It also ensures the lParam of WM_NCACTIVATE is set to -1 so as to not repaint
the client area, which can lead to a title bar incorrectly being displayed in
frameless windows.
This patch likely can't be upstreamed as-is, as Chromium doesn't have
this use case in mind currently.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
chore: bump chromium to 139.0.7219.0 (main) (#47348) * chore: bump chromium in DEPS to 139.0.7205.0 * 6543986: Mac: decouple deserializing and applying sandbox policy Refs https://chromium-review.googlesource.com/c/chromium/src/+/6543986 * 6580079: Reland 'Remove the third-party blocking feature' Refs https://chromium-review.googlesource.com/c/chromium/src/+/6580079 * 6505716: guest-contents: Add components/guest_contents Refs https://chromium-review.googlesource.com/c/chromium/src/+/6505716 * 6572556: Move LogMessageManager out of gpu_service_impl.cc. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6572556 * 6566111: Change UtilityProcessHost to manage its instance internally Refs https://chromium-review.googlesource.com/c/chromium/src/+/6566111 * 6550237: Rename ReconnectEventObserver to ConnectionChangeObserverClient Refs https://chromium-review.googlesource.com/c/chromium/src/+/6550237 * 6565918: Validate path is valid UTF8 in SelectFileDialogLinuxPortal Refs https://chromium-review.googlesource.com/c/chromium/src/+/6565918 * 6579713: Remove base::NotFatalUntil::M130 usage 6566111: Change UtilityProcessHost to manage its instance internally Refs https://chromium-review.googlesource.com/c/chromium/src/+/6579713 https://chromium-review.googlesource.com/c/chromium/src/+/6566111 * chore: update chromium patches * chore: update remaining patches * fixup! 6566111: Change UtilityProcessHost to manage its instance internally Refs https://chromium-review.googlesource.com/c/chromium/src/+/6566111 * 6577970: Remove superfluous includes for base/strings/stringprintf.h in headers Refs https://chromium-review.googlesource.com/c/chromium/src/+/6577970 * 6568811: Add FunctionCall structured metrics event for DevTools Refs https://chromium-review.googlesource.com/c/chromium/src/+/6568811 * [PDF Ink Signatures] Support PdfAnnotationsEnabled policy https://chromium-review.googlesource.com/c/chromium/src/+/6558970 * build: disable libcxx modules for rbe * chore: bump chromium in DEPS to 139.0.7217.0 * chore: bump chromium in DEPS to 139.0.7218.0 * chore: update patches fix_use_delegated_generic_capturer_when_available.patch was updated to handle a small change: 6582142: Use content::Create*Capturer in DesktopCaptureDevice. | https://chromium-review.googlesource.com/c/chromium/src/+/6582142 * chore: bump chromium in DEPS to 139.0.7219.0 * chore: update patches * 6594615: Change Chromium's deployment target to macOS 12 https://chromium-review.googlesource.com/c/chromium/src/+/6594615 Updated the assertion message to match the docs structure now too. I removed the callout to the supported versions doc because it has moved and doesn't contain minimum platform version information. * 6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_ https://chromium-review.googlesource.com/c/chromium/src/+/6606232 |NativeWindow::GetContentMinimumSize| and |NativeWindow::GetContentMaximumSize| may be good opportunities for a refactor now. * add squirrel.mac patch for removed function This was triggered by the macOS 12.0 deployment upgrade change. See: https://developer.apple.com/documentation/coreservices/1444079-uttypeconformsto?language=objc * 6582142: Use content::Create*Capturer in DesktopCaptureDevice. https://chromium-review.googlesource.com/c/chromium/src/+/6582142 * 6579732: Two minor API "quality of life" cleanups in OSCrypt Async https://chromium-review.googlesource.com/c/chromium/src/+/6579732 * chore: add include for base::SingleThreadTaskRunner Not sure what change caused this, I expect it would be a removed include somewhere else, but it's likely not important to track down. * chore: update libcxx filenames * chore: update CI build-tools commit target for macOS SDK 15.4 The following change uses an API that was added in the macOS 15.4 SDK. Support for that SDK version was added later than the current build-tools commit target. 6575804: Use a quick-and-dirty solution to avoid glitching with paste-and-go | https://chromium-review.googlesource.com/c/chromium/src/+/6575804 See: https://developer.apple.com/documentation/appkit/nspasteboard/accessbehavior-swift.enum?language=objc * fixup! 6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_ https://chromium-review.googlesource.com/c/chromium/src/+/6606232 * chore: bump chromium in DEPS to 139.0.7220.0 * chore: update patches Minor changes due to: 6613978: pwa: let events fall through in the transparent area of TopContainerView | https://chromium-review.googlesource.com/c/chromium/src/+/6613978 6614778: Refactor auto pip tab observer for Android support | https://chromium-review.googlesource.com/c/chromium/src/+/6614778 * 6543986: Mac: decouple deserializing and applying sandbox policy https://chromium-review.googlesource.com/c/chromium/src/+/6543986 The DecodeVarInt and DecodeString functions look benign from a MAS perspective. I suspect they were patched out to avoid "unused function" errors. Their complements for encoding are unpatched, supporting this idea. The code that uses these functions was refactored out of the section that we patch out. Instead of patching out that new function, I decided to treat it the same as the serialization function that is unpatched. * chore: bump chromium in DEPS to 139.0.7222.0 * chore: bump chromium in DEPS to 139.0.7224.0 * chore: bump chromium in DEPS to 139.0.7226.0 * chore: bump chromium in DEPS to 139.0.7228.0 * chore: update patches * Don't use static variable for UseExternalPopupMenus https://chromium-review.googlesource.com/c/chromium/src/+/6534657 * Reland "Roll libc++ from a01c02c9d4ac to a9cc573e7c59 https://chromium-review.googlesource.com/c/chromium/src/+/6607589 * chore: bump chromium in DEPS to 139.0.7219.0 * chore: update patches * revert Don't use static variable for UseExternalPopupMenus * tls: remove deprecated tls.createSecurePair and SecurePair https://github.com/nodejs/node/pull/57361 * Revert "Reland "Roll libc++ from a01c02c9d4ac to a9cc573e7c59" This reverts commit 33e1436a0c598ffa8cd308d08de481ed9cd22168. * test: cleanup api-desktop-capturer-spec.ts * test: more cleanup of api-desktop-capturer-spec.ts * chore: debug dcheck error in webrtc on linux * fixup patch * add debugging to desktop capturer spec * test: fixup api-desktop-capturer-spec.ts for linux * chore: remove debugging patch * Revert "fixup! 6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_ https://chromium-review.googlesource.com/c/chromium/src/+/6606232" This reverts commit 32e75651c14512572d322e819c98ab1469663bb6. * Revert "6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_" This reverts commit 89c51aa1c7771fd7f1d634486bc77f493f1d2ea9. * [views] Remove DesktopWindowTreeHostWin::window_enlargement_ https://chromium-review.googlesource.com/c/chromium/src/+/6606232 Reverting as we need this functionality for now. * fixup: remove patch that was accidentally added back --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: clavin <clavin@electronjs.org> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-06-16 12:46:06 -05:00
index 02a697ec770899a28115567b009eeceba929ed91..cd0f6b66de0306abc866996099aca3c75bdf1d66 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
chore: bump chromium to 138.0.7190.0 (main) (#47107) * chore: bump chromium in DEPS to 138.0.7180.0 * 6546797: Add a metric for the overall success of the "safe storage" item retrieval. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6546797 * 6548078: extensions: Fix TODO in ScriptInjectionTracker for desktop Android Refs https://chromium-review.googlesource.com/c/chromium/src/+/6548078 * 6544950: Revert "FSA: Only normalize the hardcoded rules once during initialization" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6544950 * chore: bump chromium in DEPS to 138.0.7181.0 * chore: update patches * fix: correctly clamp HSL shift values between 0 and 1 * chore: bump DEPS to 138.0.7183.0 * 6553142: Remove SelectFileDialogLinuxKde | https://chromium-review.googlesource.com/c/chromium/src/+/6553142 * chore: update patches * chore: bump chromium in DEPS to 138.0.7184.0 * chore: bump chromium in DEPS to 138.0.7186.0 * chore: bump chromium in DEPS to 138.0.7190.0 * chore: update patches * 6547778: Remove some superfluous //ui/gfx includes from //chrome headers | https://chromium-review.googlesource.com/c/chromium/src/+/6547778 * 6556022: Reland FSA: Only normalize the hardcoded rules once during initialization | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 * fix: remove pdf_extension_util::AddAdditionalData https://chromium-review.googlesource.com/c/chromium/src/+/4099130 This was removed 2 years ago in Chrome. * fix: provide BrowserContext to pdf_extension_util::AddAdditionalData https://chromium-review.googlesource.com/c/chromium/src/+/6558173 * fixup! 6556022: Reland FSA: Only normalize the hardcoded rules once during initialization | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 * fix: pass in navigation throttle registry https://chromium-review.googlesource.com/c/chromium/src/+/6536175 * fixup! 6556022: Reland "FSA: Only normalize the hardcoded rules once during initialization" | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 This partially reverts commit 20d709dd15ba0ff332e24ee314149d642dc5d47c. * 6545984: corner-shape: render dashed & dotted borders Refs https://chromium-review.googlesource.com/c/chromium/src/+/6545984 * Update corner smoothing expected images * Apply "future" revert commit to fix windows build > Reason for revert: Multiple eng reporting that this is causing build failures due to too-long pathnames, with no immediate feasible workaround This issue also affects our CI builds. Problematic CL in current roll: 6494836: [webgl] Add stub WebGL[2]RenderingContextWebGPU | https://chromium-review.googlesource.com/c/chromium/src/+/6494836 "Future" revert CL: 6565622: Revert "[webgl] Add stub WebGL[2]RenderingContextWebGPU" | https://chromium-review.googlesource.com/c/chromium/src/+/6565622 This patch should automatically disappear when we roll the revert. * 6533919: win: don't add WS_CAPTION style to popup windows https://chromium-review.googlesource.com/c/chromium/src/+/6533919 This mirrors the change made earlier to the code ours is based on: 6374074: [headless] Provide headless aware window metrics on Windows | https://chromium-review.googlesource.com/c/chromium/src/+/6374074 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: clavin <clavin@electronjs.org>
2025-06-03 11:19:20 -04:00
@@ -937,13 +937,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
void HWNDMessageHandler::PaintAsActiveChanged() {
if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
- !delegate_->HasFrame() ||
+ (!delegate_->HasFrame() && !is_translucent_) ||
(delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN)) {
return;
}
DefWindowProcWithRedrawLock(WM_NCACTIVATE, delegate_->ShouldPaintAsActive(),
- 0);
+ delegate_->HasFrame() ? 0 : -1);
}
void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
chore: bump chromium to 138.0.7190.0 (main) (#47107) * chore: bump chromium in DEPS to 138.0.7180.0 * 6546797: Add a metric for the overall success of the "safe storage" item retrieval. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6546797 * 6548078: extensions: Fix TODO in ScriptInjectionTracker for desktop Android Refs https://chromium-review.googlesource.com/c/chromium/src/+/6548078 * 6544950: Revert "FSA: Only normalize the hardcoded rules once during initialization" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6544950 * chore: bump chromium in DEPS to 138.0.7181.0 * chore: update patches * fix: correctly clamp HSL shift values between 0 and 1 * chore: bump DEPS to 138.0.7183.0 * 6553142: Remove SelectFileDialogLinuxKde | https://chromium-review.googlesource.com/c/chromium/src/+/6553142 * chore: update patches * chore: bump chromium in DEPS to 138.0.7184.0 * chore: bump chromium in DEPS to 138.0.7186.0 * chore: bump chromium in DEPS to 138.0.7190.0 * chore: update patches * 6547778: Remove some superfluous //ui/gfx includes from //chrome headers | https://chromium-review.googlesource.com/c/chromium/src/+/6547778 * 6556022: Reland FSA: Only normalize the hardcoded rules once during initialization | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 * fix: remove pdf_extension_util::AddAdditionalData https://chromium-review.googlesource.com/c/chromium/src/+/4099130 This was removed 2 years ago in Chrome. * fix: provide BrowserContext to pdf_extension_util::AddAdditionalData https://chromium-review.googlesource.com/c/chromium/src/+/6558173 * fixup! 6556022: Reland FSA: Only normalize the hardcoded rules once during initialization | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 * fix: pass in navigation throttle registry https://chromium-review.googlesource.com/c/chromium/src/+/6536175 * fixup! 6556022: Reland "FSA: Only normalize the hardcoded rules once during initialization" | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 This partially reverts commit 20d709dd15ba0ff332e24ee314149d642dc5d47c. * 6545984: corner-shape: render dashed & dotted borders Refs https://chromium-review.googlesource.com/c/chromium/src/+/6545984 * Update corner smoothing expected images * Apply "future" revert commit to fix windows build > Reason for revert: Multiple eng reporting that this is causing build failures due to too-long pathnames, with no immediate feasible workaround This issue also affects our CI builds. Problematic CL in current roll: 6494836: [webgl] Add stub WebGL[2]RenderingContextWebGPU | https://chromium-review.googlesource.com/c/chromium/src/+/6494836 "Future" revert CL: 6565622: Revert "[webgl] Add stub WebGL[2]RenderingContextWebGPU" | https://chromium-review.googlesource.com/c/chromium/src/+/6565622 This patch should automatically disappear when we roll the revert. * 6533919: win: don't add WS_CAPTION style to popup windows https://chromium-review.googlesource.com/c/chromium/src/+/6533919 This mirrors the change made earlier to the code ours is based on: 6374074: [headless] Provide headless aware window metrics on Windows | https://chromium-review.googlesource.com/c/chromium/src/+/6374074 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: clavin <clavin@electronjs.org>
2025-06-03 11:19:20 -04:00
@@ -1732,7 +1732,7 @@ void HWNDMessageHandler::OnActivateApp(BOOL active, DWORD thread_id) {
if (delegate_->HasNonClientView() && !active &&
thread_id != GetCurrentThreadId()) {
// Update the native frame if it is rendering the non-client area.
- if (HasSystemFrame()) {
+ if (is_translucent_ || HasSystemFrame()) {
DefWindowProcWithRedrawLock(WM_NCACTIVATE, FALSE, 0);
}
}
chore: bump chromium to 138.0.7190.0 (main) (#47107) * chore: bump chromium in DEPS to 138.0.7180.0 * 6546797: Add a metric for the overall success of the "safe storage" item retrieval. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6546797 * 6548078: extensions: Fix TODO in ScriptInjectionTracker for desktop Android Refs https://chromium-review.googlesource.com/c/chromium/src/+/6548078 * 6544950: Revert "FSA: Only normalize the hardcoded rules once during initialization" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6544950 * chore: bump chromium in DEPS to 138.0.7181.0 * chore: update patches * fix: correctly clamp HSL shift values between 0 and 1 * chore: bump DEPS to 138.0.7183.0 * 6553142: Remove SelectFileDialogLinuxKde | https://chromium-review.googlesource.com/c/chromium/src/+/6553142 * chore: update patches * chore: bump chromium in DEPS to 138.0.7184.0 * chore: bump chromium in DEPS to 138.0.7186.0 * chore: bump chromium in DEPS to 138.0.7190.0 * chore: update patches * 6547778: Remove some superfluous //ui/gfx includes from //chrome headers | https://chromium-review.googlesource.com/c/chromium/src/+/6547778 * 6556022: Reland FSA: Only normalize the hardcoded rules once during initialization | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 * fix: remove pdf_extension_util::AddAdditionalData https://chromium-review.googlesource.com/c/chromium/src/+/4099130 This was removed 2 years ago in Chrome. * fix: provide BrowserContext to pdf_extension_util::AddAdditionalData https://chromium-review.googlesource.com/c/chromium/src/+/6558173 * fixup! 6556022: Reland FSA: Only normalize the hardcoded rules once during initialization | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 * fix: pass in navigation throttle registry https://chromium-review.googlesource.com/c/chromium/src/+/6536175 * fixup! 6556022: Reland "FSA: Only normalize the hardcoded rules once during initialization" | https://chromium-review.googlesource.com/c/chromium/src/+/6556022 This partially reverts commit 20d709dd15ba0ff332e24ee314149d642dc5d47c. * 6545984: corner-shape: render dashed & dotted borders Refs https://chromium-review.googlesource.com/c/chromium/src/+/6545984 * Update corner smoothing expected images * Apply "future" revert commit to fix windows build > Reason for revert: Multiple eng reporting that this is causing build failures due to too-long pathnames, with no immediate feasible workaround This issue also affects our CI builds. Problematic CL in current roll: 6494836: [webgl] Add stub WebGL[2]RenderingContextWebGPU | https://chromium-review.googlesource.com/c/chromium/src/+/6494836 "Future" revert CL: 6565622: Revert "[webgl] Add stub WebGL[2]RenderingContextWebGPU" | https://chromium-review.googlesource.com/c/chromium/src/+/6565622 This patch should automatically disappear when we roll the revert. * 6533919: win: don't add WS_CAPTION style to popup windows https://chromium-review.googlesource.com/c/chromium/src/+/6533919 This mirrors the change made earlier to the code ours is based on: 6374074: [headless] Provide headless aware window metrics on Windows | https://chromium-review.googlesource.com/c/chromium/src/+/6374074 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: clavin <clavin@electronjs.org>
2025-06-03 11:19:20 -04:00
@@ -2340,17 +2340,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
delegate_->SchedulePaint();
chore: bump chromium to 133.0.6920.0 (main) (#45055) * chore: bump chromium in DEPS to 133.0.6902.0 * chore: bump chromium in DEPS to 133.0.6903.0 * chore: update patches * Update PdfViewer Save File Picker to use showSaveFilePicker. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6074308 * Code Health: Clean up stale MacWebContentsOcclusion Refs https://chromium-review.googlesource.com/c/chromium/src/+/6078344 * Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID Refs https://chromium-review.googlesource.com/c/chromium/src/+/6065543 * [WebRTC] Make WebRTC IP Handling policy a mojo enum Refs https://chromium-review.googlesource.com/c/chromium/src/+/6063620 * chore: gen filenames.libcxx.gni * Remove allow_unsafe_buffers pragma in //printing Refs https://chromium-review.googlesource.com/c/chromium/src/+/6092280 * refactor: to use ChildProcessId where possible Refs https://issues.chromium.org/issues/379869738 * [Win] Update TabletMode detection code Refs https://chromium-review.googlesource.com/c/chromium/src/+/6003486 * chore: bump chromium in DEPS to 133.0.6905.0 * chore: update patches * Reland "Move global shortcut listener to //ui/base" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6099035 * [shared storage] Implement the batch `with_lock` option for response header Refs https://chromium-review.googlesource.com/c/chromium/src/+/6072742 * chore: bump chromium in DEPS to 133.0.6907.0 * chore: bump chromium in DEPS to 133.0.6909.0 * chore: bump chromium in DEPS to 133.0.6911.0 * chore: bump chromium in DEPS to 133.0.6912.0 * chore: update patches * WebUI: Reveal hidden deps to ui/webui/resources. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6096291 * chore: bump chromium in DEPS to 133.0.6913.0 * chore: bump chromium in DEPS to 133.0.6915.0 * Code Health: Clean up stale base::Feature "AccessibilityTreeForViews" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6104174 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fix: remove fastapitypedarray usage * chore: update patches * chore: script/gen-libc++-filenames.js * Code Health: Clean up stale base::Feature "WinRetrieveSuggestionsOnlyOnDemand" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6109477 * fix: empty suggestions with windows platform checker Amends the fix from https://github.com/electron/electron/pull/29690 since the feature flag is no longer available. We follow the same pattern as //chrome/browser/renderer_context_menu/spelling_menu_observer.cc to generate the suggestion list on demand when context menu action is invoked. Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fixup! fix: empty suggestions with windows platform checker * fixup! fix: empty suggestions with windows platform checker * revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | https://chromium-review.googlesource.com/c/chromium/src/+/6078344 * Revert "revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | https://chromium-review.googlesource.com/c/chromium/src/+/6078344" This reverts commit 9cacda452ed5a072351e8f5a35b009d91843a08c. * chore: bump to 133.0.6920.0, update patches * Revert "6078344: Code Health: Clean up stale MacWebContentsOcclusion" Refs: https://chromium-review.googlesource.com/c/chromium/src/+/6078344 * fixup! Update PdfViewer Save File Picker to use showSaveFilePicker. --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2025-01-10 10:52:34 -06:00
}
- // Calling DefWindowProc is only necessary if there's a system frame being
- // drawn. Otherwise it can draw an incorrect title bar and cause visual
- // corruption.
- if (!delegate_->HasFrame() ||
+ // If the window is translucent, it may have the Mica background.
+ // In that case, it's necessary to call |DefWindowProc|, but we can
+ // pass -1 in the lParam to prevent any non-client area elements from
+ // being displayed.
+ if ((!delegate_->HasFrame() && !is_translucent_) ||
delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN) {
SetMsgHandled(TRUE);
return TRUE;
}
return DefWindowProcWithRedrawLock(WM_NCACTIVATE, paint_as_active || active,
- 0);
+ delegate_->HasFrame() ? 0 : -1);
}
LRESULT HWNDMessageHandler::OnNCCalcSize(BOOL mode, LPARAM l_param) {