![electron-roller[bot]](/assets/img/avatar_default.png)
* chore: bump chromium in DEPS to 138.0.7166.0 * chore: bump chromium in DEPS to 138.0.7166.2 * 6508373: Add WebContents, Tab getters for future Clank navigation capture rework6508373
* 6470924: Introduce auto-populated Search Engine icons.6470924
* 6502977: Force same tab navigation while actor coordinator is acting on a tab6502977
* chore: bump chromium in DEPS to 138.0.7168.0 * chore: update patches * fix grit patch * chore: bump Chromium to 138.0.7169.2 * fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework * 6493688: NavigationThrottleRunner2: void CreateThrottlesForNavigation6493688
* 6488755: Reland "WebSQL: Remove WebPreference"6488755
* 6428707: FSA: Only normalize the hardcoded rules once during initialization6428707
* chore: fixup patch indices * chore: bump chromium in DEPS to 138.0.7170.0 * 6514121: Remove origin calculation debug info and related methods6514121
* chore: bump chromium in DEPS to 138.0.7172.0 * chore: bump chromium in DEPS to 138.0.7173.0 * chore: bump chromium in DEPS to 138.0.7175.0 * fixup! 6514121: Remove origin calculation debug info and related methods Refs6514121
* 6531585: Don't retry LayerTreeSink creation on the high priority queue Refs6531585
* 6512253: Modernize base::apple's base bundle ID Refs6512253
* fixup! 6428707: FSA: Only normalize the hardcoded rules once during initialization Refs6428707
* fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework Refs6508373
* chore: update patches --------- 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>
68 lines
2.8 KiB
Diff
68 lines
2.8 KiB
Diff
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
|
|
index 88f658aeb32a3181e3a0cd45fbd2aacad95116aa..cef61dcf3ab89f06cba16f309e800dbab5a7cc05 100644
|
|
--- a/ui/views/win/hwnd_message_handler.cc
|
|
+++ b/ui/views/win/hwnd_message_handler.cc
|
|
@@ -936,13 +936,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,
|
|
@@ -1728,7 +1728,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);
|
|
}
|
|
}
|
|
@@ -2336,17 +2336,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
|
delegate_->SchedulePaint();
|
|
}
|
|
|
|
- // 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) {
|