Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More vibrancy fixes (#12157) #12171

Merged
merged 1 commit into from Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions atom/browser/native_window_mac.mm
Expand Up @@ -31,6 +31,7 @@
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/gfx/skia_util.h"
#include "ui/gl/gpu_switching_manager.h"

namespace {

Expand Down Expand Up @@ -1712,16 +1713,20 @@ static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,

[vibrant_view removeFromSuperview];
[window_ setVibrantView:nil];
ui::GpuSwitchingManager::SetTransparent(transparent());

return;
}

SetRenderWidgetHostOpaque(false);
background_color_before_vibrancy_.reset([window_ backgroundColor]);
transparency_before_vibrancy_ = [window_ titlebarAppearsTransparent];
ui::GpuSwitchingManager::SetTransparent(true);

[window_ setTitlebarAppearsTransparent:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
if (title_bar_style_ != NORMAL) {
[window_ setTitlebarAppearsTransparent:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
}

NSVisualEffectView* effect_view = (NSVisualEffectView*)vibrant_view;
if (effect_view == nil) {
Expand Down
4 changes: 3 additions & 1 deletion docs/api/browser-window.md
Expand Up @@ -235,7 +235,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
window shadow and window animations. Default is `true`.
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
`menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`.
`menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. Please note that
using `frame: false` in combination with a vibrancy value requires that you use a
non-default `titleBarStyle` as well.
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
option-clicking the green stoplight button on the toolbar or by clicking the
Window > Zoom menu item. If `true`, the window will grow to the preferred
Expand Down