Skip to content

Commit

Permalink
feat: remove visibleOnFullscreen option (#21706)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jan 10, 2020
1 parent 48ae755 commit 2858471
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 24 deletions.
5 changes: 1 addition & 4 deletions docs/api/browser-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -1627,12 +1627,9 @@ can still bring up the menu bar by pressing the single `Alt` key.

Returns `Boolean` - Whether the menu bar is visible.

#### `win.setVisibleOnAllWorkspaces(visible[, options])`
#### `win.setVisibleOnAllWorkspaces(visible)`

* `visible` Boolean
* `options` Object (optional)
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
the window should be visible above fullscreen windows

Sets whether the window should be visible on all workspaces.

Expand Down
9 changes: 2 additions & 7 deletions shell/browser/api/atom_api_top_level_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -790,13 +790,8 @@ void TopLevelWindow::SetOverlayIcon(const gfx::Image& overlay,
window_->SetOverlayIcon(overlay, description);
}

void TopLevelWindow::SetVisibleOnAllWorkspaces(bool visible,
gin_helper::Arguments* args) {
gin_helper::Dictionary options;
bool visibleOnFullScreen = false;
args->GetNext(&options) &&
options.Get("visibleOnFullScreen", &visibleOnFullScreen);
return window_->SetVisibleOnAllWorkspaces(visible, visibleOnFullScreen);
void TopLevelWindow::SetVisibleOnAllWorkspaces(bool visible) {
return window_->SetVisibleOnAllWorkspaces(visible);
}

bool TopLevelWindow::IsVisibleOnAllWorkspaces() {
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/atom_api_top_level_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class TopLevelWindow : public gin_helper::TrackableObject<TopLevelWindow>,
void SetProgressBar(double progress, gin_helper::Arguments* args);
void SetOverlayIcon(const gfx::Image& overlay,
const std::string& description);
void SetVisibleOnAllWorkspaces(bool visible, gin_helper::Arguments* args);
void SetVisibleOnAllWorkspaces(bool visible);
bool IsVisibleOnAllWorkspaces();
void SetAutoHideCursor(bool auto_hide);
virtual void SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value);
Expand Down
3 changes: 1 addition & 2 deletions shell/browser/native_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ class NativeWindow : public base::SupportsUserData,
const std::string& description) = 0;

// Workspace APIs.
virtual void SetVisibleOnAllWorkspaces(bool visible,
bool visibleOnFullScreen = false) = 0;
virtual void SetVisibleOnAllWorkspaces(bool visible) = 0;

virtual bool IsVisibleOnAllWorkspaces() = 0;

Expand Down
3 changes: 1 addition & 2 deletions shell/browser/native_window_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class NativeWindowMac : public NativeWindow {
void SetOverlayIcon(const gfx::Image& overlay,
const std::string& description) override;

void SetVisibleOnAllWorkspaces(bool visible,
bool visibleOnFullScreen) override;
void SetVisibleOnAllWorkspaces(bool visible) override;
bool IsVisibleOnAllWorkspaces() override;

void SetAutoHideCursor(bool auto_hide) override;
Expand Down
5 changes: 1 addition & 4 deletions shell/browser/native_window_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1271,11 +1271,8 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
void NativeWindowMac::SetOverlayIcon(const gfx::Image& overlay,
const std::string& description) {}

void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible,
bool visibleOnFullScreen) {
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible) {
SetCollectionBehavior(visible, NSWindowCollectionBehaviorCanJoinAllSpaces);
SetCollectionBehavior(visibleOnFullScreen,
NSWindowCollectionBehaviorFullScreenAuxiliary);
}

bool NativeWindowMac::IsVisibleOnAllWorkspaces() {
Expand Down
3 changes: 1 addition & 2 deletions shell/browser/native_window_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1156,8 +1156,7 @@ bool NativeWindowViews::IsMenuBarVisible() {
return root_view_->IsMenuBarVisible();
}

void NativeWindowViews::SetVisibleOnAllWorkspaces(bool visible,
bool visibleOnFullScreen) {
void NativeWindowViews::SetVisibleOnAllWorkspaces(bool visible) {
widget()->SetVisibleOnAllWorkspaces(visible);
}

Expand Down
3 changes: 1 addition & 2 deletions shell/browser/native_window_views.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ class NativeWindowViews : public NativeWindow,
void SetMenuBarVisibility(bool visible) override;
bool IsMenuBarVisible() override;

void SetVisibleOnAllWorkspaces(bool visible,
bool visibleOnFullScreen) override;
void SetVisibleOnAllWorkspaces(bool visible) override;

bool IsVisibleOnAllWorkspaces() override;

Expand Down

0 comments on commit 2858471

Please sign in to comment.