0a3ec0899d
* chore: bump chromium to 128.0.6611.0 (main) (#42779) * chore: bump chromium in DEPS to 128.0.6577.0 * chore: bump chromium in DEPS to 128.0.6579.0 * 5675706: Reland "Reland "Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al"""" https://chromium-review.googlesource.com/c/chromium/src/+/5675706 * 5668597: [PDF Ink Signatures] Prompt download menu on save when there are edits https://chromium-review.googlesource.com/c/chromium/src/+/5668597 * 5677014: Reland "Pull data_sharing_sdk from CIPD" https://chromium-review.googlesource.com/c/chromium/src/+/5677014 * chore: fixup patch indices * chore: bump chromium in DEPS to 128.0.6581.0 * chore: bump chromium in DEPS to 128.0.6583.0 * update patches * 5455480: [Extensions] Allow service worker requests to continue without a cert https://chromium-review.googlesource.com/c/chromium/src/+/5455480 * try to get some debugging output from script/push-patch.js * chore: bump chromium in DEPS to 128.0.6585.0 * chore: bump chromium in DEPS to 128.0.6587.0 * update patches * chore: bump chromium in DEPS to 128.0.6589.0 * more patch work * maybe over here? * chore: update patches * 5673207: [HTTPS Upgrades] Disable in captive portal login webview https://chromium-review.googlesource.com/c/chromium/src/+/5673207 * 5636785: Extensions: WAR: manifest.json's use_dynamic_url requires a dynamic url https://chromium-review.googlesource.com/c/chromium/src/+/5636785 * chore: bump chromium in DEPS to 128.0.6591.0 * 5665458: Trigger WN2 page when feature is enabled https://chromium-review.googlesource.com/c/chromium/src/+/5665458 * update patches * chore: bump chromium in DEPS to 128.0.6593.0 * chore: bump chromium in DEPS to 128.0.6595.0 * chore: bump chromium in DEPS to 128.0.6597.0 * (patch update) 5694586: [compile hints] Remove the usage of v8::Isolate::SetJavaScriptCompileHintsMagicEnabledCallback API https://chromium-review.googlesource.com/c/chromium/src/+/5694586 * update patches * 5691287: Reland "Change blink::WebKeyboardEvent to use std::array in is members" https://chromium-review.googlesource.com/c/chromium/src/+/5691287 The code changed here is modeled after code in `content/renderer/pepper/event_conversion.cc` that was also modified in this CL, so I took the same approach. * 5529018: Cleanup EnableWebHidOnExtensionServiceWorker flag https://chromium-review.googlesource.com/c/chromium/src/+/5529018 * 5526324: [Code Health] Add deprecation comment for base::SupportsWeakPtr. https://chromium-review.googlesource.com/c/chromium/src/+/5526324 Note that this CL actually does make `SupportsWeakPtr` strictly restricted to existing implementations, no new ones. We could add a patch to add ourselves to this list, but it looks like we'll have to refactor this anyways in the near future. Since the refactor seems straightforward, let's try that first. * chore: bump chromium in DEPS to 128.0.6598.0 * chore: update patches * 5704737: Rename ExclusiveAccessContext::GetActiveWebContents to avoid conflict https://chromium-review.googlesource.com/c/chromium/src/+/5704737 * chore: bump chromium in DEPS to 128.0.6601.0 * chore: update patches * Add `base::StringPiece` header includes Chromium is working on replacing `base::StringPiece` with `std::string_view`. (See the Chromium Bug below.) They're currently running mass codemods (across many multiple changes) to replace uses of `StringPiece` with `string_view`, including removing the header include for `StringPiece` in those files. This cascades down to our files that were implicitly depending on those includes through some other include. They're on track to eventually deprecate and remove `StringPiece` so our code should be converted, but that can be done as an upgrade follow-up task. For now, adding the header back to files that need it should suffice for minimal upgrade changes. Chromium Bug: https://issues.chromium.org/issues/40506050 * 5702737: GlobalRequestID: Avoid unwanted inlining and narrowing int conversions https://chromium-review.googlesource.com/c/chromium/src/+/5702737 contender for smallest commit 2024 * 5706534: Rename GlobalFeatures to GlobalDesktopFeatures. https://chromium-review.googlesource.com/c/chromium/src/+/5706534 * 5691321: ui: remove params variants of SelectFile listener functions https://chromium-review.googlesource.com/c/chromium/src/+/5691321 * 5714949: [Extensions] Display re-enable dialog for MV2 disabled stage https://chromium-review.googlesource.com/c/chromium/src/+/5714949 * chore: update libc++ filenames * patch: disable scope reuse & associated dchecks in v8 (hopefully temp, upgrade follow-up) * fixup! Add `base::StringPiece` header includes * update MAS patch 5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception https://chromium-review.googlesource.com/c/chromium/src/+/5710330 * chore: bump chromium in DEPS to 128.0.6603.0 * chore: update patches * 5713258: Reland "Preparation for decoupling creation/initialization of context" https://chromium-review.googlesource.com/c/chromium/src/+/5713258 When destroying a context, it must already be shutdown, and this change enforces it with a new CHECK. We were overriding `BrowserContextKeyedServiceFactory::BrowserContextShutdown` with an empty implementation, which differed from the default implementation that notifies the `KeyedServiceFactory` that the context has shutdown. Since we were missing this notification, the CHECK would later trip when the service was being destoryed because it was not registered as shutdown when it was shutdown. * chore: bump chromium in DEPS to 128.0.6605.2 * chore: update patches * refactor: linux open/save dialog patch Our existing implementation was relying on an opaque `void* params` parameter that was passed through `ui::SelectFileDialog`. Recently, that parameter has been getting removed: - 5691321: ui: remove params variants of SelectFile listener functions | https://chromium-review.googlesource.com/c/chromium/src/+/5691321 - 5709097: ui: remove SelectFileDialog impl params | https://chromium-review.googlesource.com/c/chromium/src/+/5709097 - https://issues.chromium.org/issues/340178601 "reconsider SelectFileDialog" This restructures the patch to work with mostly the same mechanics, but directly on the `ui::SelectFileDialog` object. This nets us some wins in terms of a smaller patch. * 5713262: DevTools UI binding AIDA client event returns response https://chromium-review.googlesource.com/c/chromium/src/+/5713262 * fixup! refactor: linux open/save dialog patch * chore: bump chromium in DEPS to 128.0.6606.0 * chore: update patches * fixup! refactor: linux open/save dialog patch * chore: bump chromium in DEPS to 128.0.6607.0 * chore: update printing.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5722937 * fix: pwd error in electron-test, nan-test fix: unshallow depot_tools before 3-way apply * chore: e patches all * fixup! fix: pwd error in electron-test, nan-test * chore: bump chromium in DEPS to 128.0.6609.0 * chore: bump chromium in DEPS to 128.0.6611.0 * chore: update patches * chore: update libcxx filenames --------- 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: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: clavin <clavin@electronjs.org> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: Alice Zhao <alice@makenotion.com> * chore: delete duplicate declaration from merge conflict * chore: bump chromium in DEPS to 128.0.6613.7 * Revert "chore: bump chromium in DEPS to 128.0.6613.7" This reverts commit 78047428269c79d4d3532619daf0f07e307f4dbc. --------- 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: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: clavin <clavin@electronjs.org> Co-authored-by: Charles Kerr <charles@charleskerr.com>
216 lines
11 KiB
Diff
216 lines
11 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: msizanoen1 <msizanoen@qtmlabs.xyz>
|
|
Date: Tue, 19 Jul 2022 05:11:06 +0200
|
|
Subject: Add maximized parameter to LinuxUI::GetWindowFrameProvider
|
|
|
|
This allows ClientFrameViewLinux to instruct the toolkit to draw the window
|
|
decorations in maximized mode where needed, preventing empty space caused
|
|
by decoration shadows and rounded titlebars around the window while maximized.
|
|
|
|
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
|
|
index ca2fc0b1b3fe9f7fd65f55f8924b4b5e324bfdd4..da8ebfad6404c59471dc31625aeb4e68659116a3 100644
|
|
--- a/ui/gtk/gtk_ui.cc
|
|
+++ b/ui/gtk/gtk_ui.cc
|
|
@@ -577,11 +577,12 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
|
|
}
|
|
|
|
ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame,
|
|
- bool tiled) {
|
|
- auto& provider = frame_providers_[solid_frame][tiled];
|
|
+ bool tiled,
|
|
+ bool maximized) {
|
|
+ auto& provider = frame_providers_[solid_frame][tiled][maximized];
|
|
if (!provider) {
|
|
provider =
|
|
- std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, tiled);
|
|
+ std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, tiled, maximized);
|
|
}
|
|
return provider.get();
|
|
}
|
|
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
|
|
index 32051374590fc1179e5cfa21ebc34474d2ce0190..09e9399a67d30d4686f4c141050538b8dde9f301 100644
|
|
--- a/ui/gtk/gtk_ui.h
|
|
+++ b/ui/gtk/gtk_ui.h
|
|
@@ -110,7 +110,8 @@ class GtkUi : public ui::LinuxUiAndTheme {
|
|
void SetAccentColor(std::optional<SkColor> accent_color) override;
|
|
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
|
|
ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame,
|
|
- bool tiled) override;
|
|
+ bool tiled,
|
|
+ bool maximized) override;
|
|
|
|
private:
|
|
using TintMap = std::map<int, color_utils::HSL>;
|
|
@@ -199,7 +200,7 @@ class GtkUi : public ui::LinuxUiAndTheme {
|
|
// while Chrome is running. This 2D array is indexed first by whether the
|
|
// frame is translucent (0) or solid(1), then by whether the frame is normal
|
|
// (0) or tiled (1).
|
|
- std::unique_ptr<ui::WindowFrameProvider> frame_providers_[2][2];
|
|
+ std::unique_ptr<ui::WindowFrameProvider> frame_providers_[2][2][2];
|
|
|
|
// Objects to notify when the window frame button order changes.
|
|
base::ObserverList<ui::WindowButtonOrderObserver>::Unchecked
|
|
diff --git a/ui/gtk/window_frame_provider_gtk.cc b/ui/gtk/window_frame_provider_gtk.cc
|
|
index e24cce85b453ecee9a4854bfdf7b8eeb6814f8c3..d3e3e9b918011c433b4ac6ded245803410ccb5d4 100644
|
|
--- a/ui/gtk/window_frame_provider_gtk.cc
|
|
+++ b/ui/gtk/window_frame_provider_gtk.cc
|
|
@@ -29,20 +29,23 @@ constexpr int kMaxFrameSizeDip = 64;
|
|
// will get an incorrect hint as to which pixels are fully opaque.
|
|
constexpr int kMaxCornerRadiusDip = 32;
|
|
|
|
-GtkCssContext WindowContext(bool solid_frame, bool tiled, bool focused) {
|
|
+GtkCssContext WindowContext(bool solid_frame, bool tiled, bool maximized, bool focused) {
|
|
std::string selector = "window.background.";
|
|
selector += solid_frame ? "solid-csd" : "csd";
|
|
if (tiled) {
|
|
selector += ".tiled";
|
|
}
|
|
+ if (maximized) {
|
|
+ selector += ".maximized";
|
|
+ }
|
|
if (!focused) {
|
|
selector += ":inactive";
|
|
}
|
|
return AppendCssNodeToStyleContext({}, selector);
|
|
}
|
|
|
|
-GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool focused) {
|
|
- auto context = WindowContext(solid_frame, tiled, focused);
|
|
+GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool maximized, bool focused) {
|
|
+ auto context = WindowContext(solid_frame, tiled, maximized, focused);
|
|
// GTK4 renders the decoration directly on the window.
|
|
if (!GtkCheckVersion(4)) {
|
|
context = AppendCssNodeToStyleContext(context, "decoration");
|
|
@@ -61,8 +64,8 @@ GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool focused) {
|
|
return context;
|
|
}
|
|
|
|
-GtkCssContext HeaderContext(bool solid_frame, bool tiled, bool focused) {
|
|
- auto context = WindowContext(solid_frame, tiled, focused);
|
|
+GtkCssContext HeaderContext(bool solid_frame, bool tiled, bool maximized, bool focused) {
|
|
+ auto context = WindowContext(solid_frame, tiled, maximized, focused);
|
|
context =
|
|
AppendCssNodeToStyleContext(context, "headerbar.header-bar.titlebar");
|
|
if (!focused) {
|
|
@@ -117,8 +120,8 @@ int ComputeTopCornerRadius() {
|
|
// need to experimentally determine the corner radius by rendering a sample.
|
|
// Additionally, in GTK4, the headerbar corners get clipped by the window
|
|
// rather than the headerbar having its own rounded corners.
|
|
- auto context = GtkCheckVersion(4) ? DecorationContext(false, false, false)
|
|
- : HeaderContext(false, false, false);
|
|
+ auto context = GtkCheckVersion(4) ? DecorationContext(false, false, false, false)
|
|
+ : HeaderContext(false, false, false, false);
|
|
ApplyCssToContext(context, R"(window, headerbar {
|
|
background-image: none;
|
|
background-color: black;
|
|
@@ -152,7 +155,7 @@ int ComputeTopCornerRadius() {
|
|
bool HeaderIsTranslucent() {
|
|
// The arbitrary square size to render a sample header.
|
|
constexpr int kHeaderSize = 32;
|
|
- auto context = HeaderContext(false, false, false);
|
|
+ auto context = HeaderContext(false, false, false, false);
|
|
double opacity = GetOpacityFromContext(context);
|
|
if (opacity < 1.0) {
|
|
return true;
|
|
@@ -186,8 +189,8 @@ WindowFrameProviderGtk::Asset& WindowFrameProviderGtk::Asset::operator=(
|
|
|
|
WindowFrameProviderGtk::Asset::~Asset() = default;
|
|
|
|
-WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool tiled)
|
|
- : solid_frame_(solid_frame), tiled_(tiled) {
|
|
+WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool tiled, bool maximized)
|
|
+ : solid_frame_(solid_frame), tiled_(tiled), maximized_(maximized) {
|
|
GtkSettings* settings = gtk_settings_get_default();
|
|
// Unretained() is safe since WindowFrameProviderGtk will own the signals.
|
|
auto callback = base::BindRepeating(&WindowFrameProviderGtk::OnThemeChanged,
|
|
@@ -337,7 +340,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(gfx::Canvas* canvas,
|
|
|
|
auto header =
|
|
PaintHeaderbar({client_bounds_px.width(), top_area_height_px},
|
|
- HeaderContext(solid_frame_, tiled_, focused), scale);
|
|
+ HeaderContext(solid_frame_, tiled_, maximized_, focused), scale);
|
|
image = gfx::ImageSkia::CreateFrom1xBitmap(header);
|
|
// In GTK4, the headerbar gets clipped by the window.
|
|
if (GtkCheckVersion(4)) {
|
|
@@ -366,7 +369,7 @@ WindowFrameProviderGtk::Asset& WindowFrameProviderGtk::GetOrCreateAsset(
|
|
|
|
gfx::Rect frame_bounds_dip(kMaxFrameSizeDip, kMaxFrameSizeDip,
|
|
2 * kMaxFrameSizeDip, 2 * kMaxFrameSizeDip);
|
|
- auto focused_context = DecorationContext(solid_frame_, tiled_, true);
|
|
+ auto focused_context = DecorationContext(solid_frame_, tiled_, maximized_, true);
|
|
frame_bounds_dip.Inset(-GtkStyleContextGetPadding(focused_context));
|
|
frame_bounds_dip.Inset(-GtkStyleContextGetBorder(focused_context));
|
|
gfx::Size bitmap_size(BitmapSizePx(asset), BitmapSizePx(asset));
|
|
@@ -374,7 +377,7 @@ WindowFrameProviderGtk::Asset& WindowFrameProviderGtk::GetOrCreateAsset(
|
|
focused_context, scale);
|
|
asset.unfocused_bitmap =
|
|
PaintBitmap(bitmap_size, gfx::RectF(frame_bounds_dip),
|
|
- DecorationContext(solid_frame_, tiled_, false), scale);
|
|
+ DecorationContext(solid_frame_, tiled_, maximized_, false), scale);
|
|
|
|
return asset;
|
|
}
|
|
diff --git a/ui/gtk/window_frame_provider_gtk.h b/ui/gtk/window_frame_provider_gtk.h
|
|
index 4faaae32a203bfa57f3e61c391dc6917c4a0bf59..94050a0136b78730f607f42991742e0434948d0e 100644
|
|
--- a/ui/gtk/window_frame_provider_gtk.h
|
|
+++ b/ui/gtk/window_frame_provider_gtk.h
|
|
@@ -20,7 +20,7 @@ namespace gtk {
|
|
|
|
class WindowFrameProviderGtk : public ui::WindowFrameProvider {
|
|
public:
|
|
- WindowFrameProviderGtk(bool solid_frame, bool tiled);
|
|
+ WindowFrameProviderGtk(bool solid_frame, bool tiled, bool maximized);
|
|
|
|
WindowFrameProviderGtk(const WindowFrameProviderGtk&) = delete;
|
|
WindowFrameProviderGtk& operator=(const WindowFrameProviderGtk&) = delete;
|
|
@@ -65,6 +65,8 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
|
|
// Input parameters used for drawing.
|
|
const bool solid_frame_;
|
|
const bool tiled_;
|
|
+ // Whether to draw the window decorations as maximized.
|
|
+ const bool maximized_;
|
|
|
|
// Scale-independent metric calculated based on the bitmaps.
|
|
std::optional<gfx::Insets> frame_thickness_dip_;
|
|
diff --git a/ui/linux/fallback_linux_ui.cc b/ui/linux/fallback_linux_ui.cc
|
|
index e4a7f8eb0ef8bacd2d4e4231d0990b4a01021626..3477542587b08691c164941b2c2e3b22050231ca 100644
|
|
--- a/ui/linux/fallback_linux_ui.cc
|
|
+++ b/ui/linux/fallback_linux_ui.cc
|
|
@@ -143,7 +143,8 @@ FallbackLinuxUi::CreateNavButtonProvider() {
|
|
|
|
ui::WindowFrameProvider* FallbackLinuxUi::GetWindowFrameProvider(
|
|
bool solid_frame,
|
|
- bool tiled) {
|
|
+ bool tiled,
|
|
+ bool maximized) {
|
|
return nullptr;
|
|
}
|
|
|
|
diff --git a/ui/linux/fallback_linux_ui.h b/ui/linux/fallback_linux_ui.h
|
|
index 0800349bc18753e6a41a938c70213dd7dd123d0d..a1553e0cb1fac188fb2c74e10163c52dead02f29 100644
|
|
--- a/ui/linux/fallback_linux_ui.h
|
|
+++ b/ui/linux/fallback_linux_ui.h
|
|
@@ -67,7 +67,8 @@ class FallbackLinuxUi : public LinuxUiAndTheme {
|
|
void SetAccentColor(std::optional<SkColor> accent_color) override;
|
|
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
|
|
ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame,
|
|
- bool tiled) override;
|
|
+ bool tiled,
|
|
+ bool maximized) override;
|
|
|
|
private:
|
|
std::optional<gfx::FontRenderParams> default_font_render_params_;
|
|
diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
|
|
index 0a4c394b07a682d55639f37414331d68f175841c..45db96c165d61f551b344c7c852c083546508325 100644
|
|
--- a/ui/linux/linux_ui.h
|
|
+++ b/ui/linux/linux_ui.h
|
|
@@ -307,7 +307,8 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme {
|
|
// The returned object is not owned by the caller and will remain alive until
|
|
// the process ends.
|
|
virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame,
|
|
- bool tiled) = 0;
|
|
+ bool tiled,
|
|
+ bool maximized) = 0;
|
|
|
|
protected:
|
|
LinuxUiTheme();
|