Skip to content

Commit

Permalink
chore: deprecate visibleOnFullScreen option (#21732)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and zcbenz committed Jan 13, 2020
1 parent da45f03 commit ee65a19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/browser-window.md
Expand Up @@ -1627,7 +1627,7 @@ Returns `Boolean` - Whether the menu bar is visible.
* `visible` Boolean
* `options` Object (optional)
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
the window should be visible above fullscreen windows
the window should be visible above fullscreen windows _deprecated_

Sets whether the window should be visible on all workspaces.

Expand Down
8 changes: 8 additions & 0 deletions shell/browser/api/atom_api_top_level_window.cc
Expand Up @@ -15,6 +15,7 @@
#include "shell/browser/api/atom_api_view.h"
#include "shell/browser/api/atom_api_web_contents.h"
#include "shell/common/color_util.h"
#include "shell/common/deprecate_util.h"
#include "shell/common/gin_converters/callback_converter.h"
#include "shell/common/gin_converters/file_path_converter.h"
#include "shell/common/gin_converters/gfx_converter.h"
Expand Down Expand Up @@ -794,6 +795,13 @@ void TopLevelWindow::SetVisibleOnAllWorkspaces(bool visible,
bool visibleOnFullScreen = false;
args->GetNext(&options) &&
options.Get("visibleOnFullScreen", &visibleOnFullScreen);
if (visibleOnFullScreen) {
node::Environment* env = node::Environment::GetCurrent(args->isolate());
EmitDeprecationWarning(
env, "visibleOnFullScreen is deprecated and will be removed",
"electron");
}

return window_->SetVisibleOnAllWorkspaces(visible, visibleOnFullScreen);
}

Expand Down

0 comments on commit ee65a19

Please sign in to comment.