chrome: win: Disable taskbar decoration for PiP and DevTools windows (fixes #3645)

This commit is contained in:
Marshall Greenblatt 2024-02-15 14:17:59 -05:00
parent ec122a9148
commit 71c8b4b2bb
2 changed files with 46 additions and 0 deletions

View File

@ -717,4 +717,9 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/3641
'name': 'win_taskbar_group_3641'
},
{
# chrome: win: Disable taskbar decoration for PiP and DevTools windows.
# https://github.com/chromiumembedded/cef/issues/3645
'name': 'win_taskbar_decorator_3645'
},
]

View File

@ -0,0 +1,41 @@
diff --git chrome/browser/taskbar/taskbar_decorator_win.cc chrome/browser/taskbar/taskbar_decorator_win.cc
index 20f37cf8b31ee..85569f9a9694c 100644
--- chrome/browser/taskbar/taskbar_decorator_win.cc
+++ chrome/browser/taskbar/taskbar_decorator_win.cc
@@ -18,12 +18,14 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/win/scoped_gdi_object.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/avatar_menu.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
#include "skia/ext/font_utils.h"
#include "skia/ext/image_operations.h"
#include "skia/ext/legacy_display_globals.h"
@@ -201,6 +203,21 @@ void UpdateTaskbarDecoration(Profile* profile, gfx::NativeWindow window) {
return;
}
+#if BUILDFLAG(ENABLE_CEF)
+ if (auto browser_view = BrowserView::GetBrowserViewForNativeWindow(window)) {
+ if (auto browser = browser_view->browser()) {
+ if (browser->cef_delegate() &&
+ (browser->is_type_picture_in_picture() ||
+ browser->is_type_devtools()) &&
+ browser->cef_delegate()->HasViewsHostedOpener()) {
+ // Don't add taskbar decoration.
+ taskbar::DrawTaskbarDecoration(window, nullptr);
+ return;
+ }
+ }
+ }
+#endif // BUILDFLAG(ENABLE_CEF)
+
// We need to draw the taskbar decoration. Even though we have an icon on the
// window's relaunch details, we draw over it because the user may have
// pinned the badge-less Chrome shortcut which will cause Windows to ignore