diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 90e838d9992c..be8e5e124f58 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -1538,6 +1538,13 @@ void NativeWindowViews::SetVisibleOnAllWorkspaces( } bool NativeWindowViews::IsVisibleOnAllWorkspaces() const { + // NB: Electron >= 37 has a better long-term fix, but it also has an edge + // case which is a breaking change. The code here is dirtier (e.g. accessing + // a method marked as private) to avoid that edge case. More info @ + // https://github.com/electron/electron/pull/46834#issuecomment-2836287699 + if (const auto* view_native_widget = widget()->native_widget_private()) + return view_native_widget->IsVisibleOnAllWorkspaces(); + #if BUILDFLAG(IS_LINUX) if (IsX11()) { // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index 163be971dab9..7eacf395b266 100755 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -5408,8 +5408,7 @@ describe('BrowserWindow module', () => { }); }); - // FIXME: enable this test on Linux as well. - ifdescribe(process.platform === 'darwin')('visibleOnAllWorkspaces state', () => { + ifdescribe(process.platform !== 'win32')('visibleOnAllWorkspaces state', () => { describe('with properties', () => { it('can be changed', () => { const w = new BrowserWindow({ show: false });