Skip to content

Commit

Permalink
fix: fix vibrancy applying without transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
VerteDinde committed Oct 5, 2023
1 parent 9d0e6d0 commit f8dfc19
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions shell/browser/api/electron_api_browser_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
auto web_preferences = gin_helper::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);

bool transparent = false;
options.Get(options::kTransparent, &transparent);

std::string vibrancy_type;
#if BUILDFLAG(IS_MAC)
options.Get(options::kVibrancyType, &vibrancy_type);
#endif

// Copy the backgroundColor to webContents.
std::string color;
if (options.Get(options::kBackgroundColor, &color)) {
web_preferences.SetHidden(options::kBackgroundColor, color);
#if BUILDFLAG(IS_WIN)
} else if (window_->IsTranslucent()) {
#else
} else if (!vibrancy_type.empty() || transparent) {
#endif
// If the BrowserWindow is transparent or a vibrancy type has been set,
// also propagate transparency to the WebContents unless a separate
// backgroundColor has been set.
Expand Down

0 comments on commit f8dfc19

Please sign in to comment.