feat: enable Windows Control Overlay on Linux (#41769)

This commit is contained in:
Shelley Vohr
2024-06-27 14:56:36 +02:00
committed by GitHub
parent 1d4b00692d
commit 32e5012017
24 changed files with 1026 additions and 107 deletions

View File

@@ -167,13 +167,9 @@ class NativeWindowViews : public NativeWindow,
#if BUILDFLAG(IS_WIN)
TaskbarHost& taskbar_host() { return taskbar_host_; }
void UpdateThickFrame();
#endif
#if BUILDFLAG(IS_WIN)
bool IsWindowControlsOverlayEnabled() const {
return (title_bar_style_ == NativeWindowViews::TitleBarStyle::kHidden) &&
titlebar_overlay_;
}
SkColor overlay_button_color() const { return overlay_button_color_; }
void set_overlay_button_color(SkColor color) {
overlay_button_color_ = color;
@@ -183,9 +179,6 @@ class NativeWindowViews : public NativeWindow,
overlay_symbol_color_ = color;
}
void UpdateThickFrame();
#endif
private:
// views::WidgetObserver:
void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
@@ -263,6 +256,10 @@ class NativeWindowViews : public NativeWindow,
std::unique_ptr<EventDisabler> event_disabler_;
#endif
// The color to use as the theme and symbol colors respectively for WCO.
SkColor overlay_button_color_ = SkColor();
SkColor overlay_symbol_color_ = SkColor();
#if BUILDFLAG(IS_WIN)
ui::WindowShowState last_window_state_;
@@ -306,11 +303,6 @@ class NativeWindowViews : public NativeWindow,
std::optional<gfx::Rect> pending_bounds_change_;
// The color to use as the theme and symbol colors respectively for Window
// Controls Overlay if enabled on Windows.
SkColor overlay_button_color_;
SkColor overlay_symbol_color_;
// The message ID of the "TaskbarCreated" message, sent to us when we need to
// reset our thumbar buttons.
UINT taskbar_created_message_ = 0;