refactor: use upstream Widget::IsVisibleOnAllWorkspaces()
(#45887)
* refactor: use upstream Widget::IsVisibleOnAllWorkspaces() * chore: add to breaking changes
This commit is contained in:
parent
1b5db9989e
commit
32141eacfb
2 changed files with 9 additions and 14 deletions
|
@ -12,6 +12,13 @@ This document uses the following convention to categorize breaking changes:
|
||||||
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
|
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
|
||||||
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
|
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
|
||||||
|
|
||||||
|
## Planned Breaking API Changes (37.0)
|
||||||
|
|
||||||
|
### Behavior Changed: `BrowserWindow.IsVisibleOnAllWorkspaces()` on Linux
|
||||||
|
|
||||||
|
`BrowserWindow.IsVisibleOnAllWorkspaces()` will now return false on Linux if the
|
||||||
|
window is not currently visible.
|
||||||
|
|
||||||
## Planned Breaking API Changes (36.0)
|
## Planned Breaking API Changes (36.0)
|
||||||
|
|
||||||
### Utility Process unhandled rejection behavior change
|
### Utility Process unhandled rejection behavior change
|
||||||
|
|
|
@ -1527,20 +1527,8 @@ void NativeWindowViews::SetVisibleOnAllWorkspaces(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NativeWindowViews::IsVisibleOnAllWorkspaces() const {
|
bool NativeWindowViews::IsVisibleOnAllWorkspaces() const {
|
||||||
#if BUILDFLAG(IS_LINUX)
|
// On Windows this always returns false.
|
||||||
if (IsX11()) {
|
return widget()->IsVisibleOnAllWorkspaces();
|
||||||
// Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to
|
|
||||||
// determine whether the current window is visible on all workspaces.
|
|
||||||
x11::Atom sticky_atom = x11::GetAtom("_NET_WM_STATE_STICKY");
|
|
||||||
std::vector<x11::Atom> wm_states;
|
|
||||||
auto* connection = x11::Connection::Get();
|
|
||||||
connection->GetArrayProperty(
|
|
||||||
static_cast<x11::Window>(GetAcceleratedWidget()),
|
|
||||||
x11::GetAtom("_NET_WM_STATE"), &wm_states);
|
|
||||||
return base::Contains(wm_states, sticky_atom);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
content::DesktopMediaID NativeWindowViews::GetDesktopMediaID() const {
|
content::DesktopMediaID NativeWindowViews::GetDesktopMediaID() const {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue