From e8fb79244e6909aa91fe3ba20969d2e9b5838a10 Mon Sep 17 00:00:00 2001 From: Max Karolinskiy Date: Mon, 4 Nov 2024 18:20:38 -0500 Subject: [PATCH] [Cr131 follow up][Linux] Fixes dragging window by toolbar. When vertical tabs are enabled the window could no longer be dragged by the toolbar. This was caused by the below upstream change adding an override for NonClientHitTest to BrowserFrameViewLinux. For some reason in our chromium_src override of chrome/browser/ui/views/frame/browser_frame_view_linux.cc we were only overriding OpaqueBrowserFrameView with BraveOpaqueBrowserFrameView in c'tor and so the newly added upstream code was calling OpaqueBrowserFrameView::NonClientHitTest instead of BraveOpaqueBrowserFrameView::NonClientHitTest. Chromium change: https://source.chromium.org/chromium/chromium/src/+/d11a37c5be7bf88d0422002c4b31275eb64ad707 commit d11a37c5be7bf88d0422002c4b31275eb64ad707 Author: Tom Anderson Date: Mon Oct 7 19:04:23 2024 +0000 [Linux UI] Ensure browser windows are resizable from the top This fixes a regression in the refresh 2023 UI. The issue only occurs when the desktop doesn't support compositing and shadows aren't drawn. Normally the resize area is on the window shadows, otherwise a 4px border is drawn to give a small resize area. While the right, left, and bottom resize areas were working, the top was not since the hit test indicated the window caption was clicked. This CL adds a small top resize area to fix the issue. Bug: 347038254 --- .../brave_non_client_hit_test_helper_browsertest.cc | 9 +-------- .../browser/ui/views/frame/browser_frame_view_linux.cc | 5 +---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/browser/ui/views/frame/brave_non_client_hit_test_helper_browsertest.cc b/browser/ui/views/frame/brave_non_client_hit_test_helper_browsertest.cc index 83e08c2dc7fd..6a53931ecf00 100644 --- a/browser/ui/views/frame/brave_non_client_hit_test_helper_browsertest.cc +++ b/browser/ui/views/frame/brave_non_client_hit_test_helper_browsertest.cc @@ -17,14 +17,7 @@ using BraveNonClientHitTestHelperBrowserTest = InProcessBrowserTest; // TODO(sko) It might be good to have resizable area tests. But testing it // is pretty flaky depending on platforms. -// The test is failing on Linux CI in Chromium 131, but passes locally: -// https://github.com/brave/brave-browser/issues/41674 -#if BUILDFLAG(IS_LINUX) -#define MAYBE_Toolbar DISABLED_Toolbar -#else -#define MAYBE_Toolbar Toolbar -#endif // BUILDFLAG(IS_LINUX) -IN_PROC_BROWSER_TEST_F(BraveNonClientHitTestHelperBrowserTest, MAYBE_Toolbar) { +IN_PROC_BROWSER_TEST_F(BraveNonClientHitTestHelperBrowserTest, Toolbar) { auto* browser_view = static_cast(browser()->window()); auto* toolbar = browser_view->toolbar(); // Upstream has two more children |background_view_left_| and diff --git a/chromium_src/chrome/browser/ui/views/frame/browser_frame_view_linux.cc b/chromium_src/chrome/browser/ui/views/frame/browser_frame_view_linux.cc index 61728bbfa759..50cad0a01658 100644 --- a/chromium_src/chrome/browser/ui/views/frame/browser_frame_view_linux.cc +++ b/chromium_src/chrome/browser/ui/views/frame/browser_frame_view_linux.cc @@ -6,9 +6,6 @@ #include "chrome/browser/ui/views/frame/browser_frame_view_linux.h" #include "brave/browser/ui/views/frame/brave_opaque_browser_frame_view.h" -#define OpaqueBrowserFrameView(frame, browser_view, layout) \ - BraveOpaqueBrowserFrameView(frame, browser_view, layout) - +#define OpaqueBrowserFrameView BraveOpaqueBrowserFrameView #include "src/chrome/browser/ui/views/frame/browser_frame_view_linux.cc" - #undef OpaqueBrowserFrameView