Repository: electron/electron (language: cpp)

Issue:
[Bug]: skipTaskbar: true ignored
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

17.1.0-1-x86_64

### What operating system are you using?

Other Linux

### Operating System Version

Kernel: 5.16.11-arch1-1

### What arch are you using?

x86_64

### Last Known Working Electron version

16.0.8-2-x86_64

### Expected Behavior

electron app not shown in the taskbar

### Actual Behavior

electron app is shown in the taskbar

### Testcase Gist URL

_No response_

### Additional Information

_No response_
[Bug]: skipTaskbar: true ignored
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

17.1.0-1-x86_64

### What operating system are you using?

Other Linux

### Operating System Version

Kernel: 5.16.11-arch1-1

### What arch are you using?

x86_64

### Last Known Working Electron version

16.0.8-2-x86_64

### Expected Behavior

electron app not shown in the taskbar

### Actual Behavior

electron app is shown in the taskbar

### Testcase Gist URL

_No response_

### Additional Information

_No response_


Discussion / hints:
Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small testcases and publishing them as [gists](https://gist.github.com) that Electron maintainers can use.

I didn't know what to test. With Vers. 16.0.8-2 "skipTaskbar" works, after upgrade to Vers. 
17.1.0-1 "skipTaskbar" will be ignored, the app is shown in the taskbar like any other app as 
vivaldi, thunar etc. So I downgrade and all works fine again. In the attachment the important 
files for you from my app. I hope it helps.

Walter
Thanks. I'm always appreciative, as the owner of this, of anyone honestly
trying to improve.
H

On Thu, Mar 3, 2022, 12:58 AM Mininock-afk ***@***.***> wrote:

> I didn't know what to test. With Vers. 16.0.8-2 "skipTaskbar" works, after
> upgrade to Vers.
> 17.1.0-1 "skipTaskbar" will be ignored, the app is shown in the taskbar
> like any other app as
> vivaldi, thunar etc. So I downgrade and all works fine again. In the
> attachment the important
> files for you from my app. I hope it helps.
>
> Walter
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/electron/electron/issues/33124#issuecomment-1057734659>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIKFMZAPBGZXNMPJGASCV2DU6BPLBANCNFSM5PYHZLIA>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>

This is likely a side-effect of X11 -> Wayland migration. Currently Electron uses `_NET_WM_STATE_SKIP_TASKBAR` to tell the WM to hide an app from the taskbar.

### GNOME

According to [wayland-bites](https://wayland-bites.github.io/) the equivalent to `_NET_WM_STATE_SKIP_TASKBAR` on GNOME is with `Window.is_skip_taskbar`, but that "Since GNOME 41, WaylandClient, Workspace, WorkspaceManager, IdleMonitor and Window Meta APIs are available only to GNOME Extensions or in the unsafe mode."

The same page says that "WaylandClient.{hide_from|show_in}_window_list" might also be an approach, but that "WaylandClient controls only subprocess surfaces".

### KWin

On the KWin side, the `KWin::Toplevel::skipTaskbar` is the API to use but "[the] KWin Scripting API is available only to dedicated registered scripts."


... in short, there doesn't seem to be an easy way to do this anymore in a Wayland world, and the tradeoffs involved (e.g. running in unsafe mode) are IMO not worth the cost.

I'd be happy to be proven wrong if someone knows of a better workaround, but if the above is correct IMO we should update the documentation to say that `skipTaskbar` is not supported on Wayland
Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small testcases and publishing them as [gists](https://gist.github.com) that Electron maintainers can use.

I didn't know what to test. With Vers. 16.0.8-2 "skipTaskbar" works, after upgrade to Vers. 
17.1.0-1 "skipTaskbar" will be ignored, the app is shown in the taskbar like any other app as 
vivaldi, thunar etc. So I downgrade and all works fine again. In the attachment the important 
files for you from my app. I hope it helps.

Walter
Thanks. I'm always appreciative, as the owner of this, of anyone honestly
trying to improve.
H

On Thu, Mar 3, 2022, 12:58 AM Mininock-afk ***@***.***> wrote:

> I didn't know what to test. With Vers. 16.0.8-2 "skipTaskbar" works, after
> upgrade to Vers.
> 17.1.0-1 "skipTaskbar" will be ignored, the app is shown in the taskbar
> like any other app as
> vivaldi, thunar etc. So I downgrade and all works fine again. In the
> attachment the important
> files for you from my app. I hope it helps.
>
> Walter
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/electron/electron/issues/33124#issuecomment-1057734659>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIKFMZAPBGZXNMPJGASCV2DU6BPLBANCNFSM5PYHZLIA>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>

This is likely a side-effect of X11 -> Wayland migration. Currently Electron uses `_NET_WM_STATE_SKIP_TASKBAR` to tell the WM to hide an app from the taskbar.

### GNOME

According to [wayland-bites](https://wayland-bites.github.io/) the equivalent to `_NET_WM_STATE_SKIP_TASKBAR` on GNOME is with `Window.is_skip_taskbar`, but that "Since GNOME 41, WaylandClient, Workspace, WorkspaceManager, IdleMonitor and Window Meta APIs are available only to GNOME Extensions or in the unsafe mode."

The same page says that "WaylandClient.{hide_from|show_in}_window_list" might also be an approach, but that "WaylandClient controls only subprocess surfaces".

### KWin

On the KWin side, the `KWin::Toplevel::skipTaskbar` is the API to use but "[the] KWin Scripting API is available only to dedicated registered scripts."


... in short, there doesn't seem to be an easy way to do this anymore in a Wayland world, and the tradeoffs involved (e.g. running in unsafe mode) are IMO not worth the cost.

I'd be happy to be proven wrong if someone knows of a better workaround, but if the above is correct IMO we should update the documentation to say that `skipTaskbar` is not supported on Wayland

Fix patch:
diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md
index bc407ede48021..ce2956d9ad6e6 100644
--- a/docs/api/browser-window.md
+++ b/docs/api/browser-window.md
@@ -174,8 +174,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
     mode. On macOS, also whether the maximize/zoom button should toggle full
     screen mode or maximize window. Default is `true`.
   * `simpleFullscreen` boolean (optional) - Use pre-Lion fullscreen on macOS. Default is `false`.
-  * `skipTaskbar` boolean (optional) - Whether to show the window in taskbar. Default is
-    `false`.
+  * `skipTaskbar` boolean (optional) _macOS_ _Windows_ - Whether to show the window in taskbar.
+    Default is `false`.
   * `kiosk` boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
   * `title` string (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
   * `icon` ([NativeImage](native-image.md) | string) (optional) - The window icon. On Windows it is
diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md
index 6d561f87bd75e..c44fcc257ef52 100644
--- a/docs/breaking-changes.md
+++ b/docs/breaking-changes.md
@@ -27,9 +27,20 @@ preload scripts _do_ depend on Node, either refactor them to remove Node usage
 from the renderer, or explicitly specify `sandbox: false` for the relevant
 renderers.
 
+### Removed: `skipTaskbar` on Linux
+
+See `skipTaskbar` discussion in 19.0 below. This feature is not available on
+Wayland. Since most modern Linux desktops are transitioning to Wayland, this
+feature will be removed for Linux.
+
 ## Planned Breaking API Changes (19.0)
 
-*None (yet)*
+### Unsupported: `skipTaskbar` on Linux
+
+On X11, `skipTaskbar` sends a `_NET_WM_STATE_SKIP_TASKBAR` message to the X11
+window manager. There is not a direct equivalent for Wayland, and the known
+workarounds have unacceptable tradeoffs (e.g. Window.is_skip_taskbar in GNOME
+requires unsafe mode), so Electron is unable to support this feature on Linux.
 
 ## Planned Breaking API Changes (18.0)
 
diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc
index a5c58964016c3..47901e9263e02 100644
--- a/shell/browser/native_window_views.cc
+++ b/shell/browser/native_window_views.cc
@@ -291,6 +291,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
 #endif
 
 #if defined(USE_X11)
+  // TODO(ckerr): remove in Electron v20.0.0
   // Before the window is mapped the SetWMSpecState can not work, so we have
   // to manually set the _NET_WM_STATE.
   std::vector<x11::Atom> state_atom_list;


Test patch: