Skip to content

Fix: Hide 'Minimize to system tray' setting on Wayland#9208

Open
Shadorc wants to merge 11 commits into
FreeTubeApp:developmentfrom
Shadorc:feat/tray-tooltip
Open

Fix: Hide 'Minimize to system tray' setting on Wayland#9208
Shadorc wants to merge 11 commits into
FreeTubeApp:developmentfrom
Shadorc:feat/tray-tooltip

Conversation

@Shadorc

@Shadorc Shadorc commented May 29, 2026

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #9187

Description

Wayland does not have a 'minimize' event (see electron/electron#51766 (comment)).
FreeTube can't really do anything on its side, nor can Electron.
Similar to MacOS, the fix is to hide this setting if Wayland is detected.

Testing

Linux Wayland

  1. Execute FreeTube on Linux Wayland
  2. Check that 'Minimize to tray' setting is hidden

Linux Wayland with compatibility mode

  1. Execute FreeTube on Linux Wayland with --ozone-platform=x11
  2. Check that 'Minimize to tray' setting is visible and working as intended

Windows

  1. Execute FreeTube on Windows
  2. Check that 'Minimize to tray' setting is visible and working as intended

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 29, 2026 08:46
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 29, 2026
auto-merge was automatically disabled May 29, 2026 09:18

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 29, 2026 09:18
@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

im wondering if we could just hide the setting when wayland is detected

@Shadorc

Shadorc commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

I've spent some time searching to find out how to detect if we are using Wayland, but there doesn't seem to be a simple solution.
The standard approach is to rely on XDG_SESSION_TYPE, but as I mentioned in my issue, you can run Electron with --ozone-platform=x11 and it will work. This means we should also check for this argument.
There are people #9187 (comment) that use Wayland but seem to have their OS running FreeTube with X11 compatibility mode or something.
You can also use software like XWayland to run Wayland apps on an X11 server. It might change the XDG_SESSION_TYPE value correctly, but that seems like too many scenarios to implement something simple and reliable.

@Shadorc

Shadorc commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

I've tested with two electron-based apps that I use: Discord and Signal.
They have a different approach, they both consider that "Minimize to system tray" can only occur when a user presses the close button, removing the app from the taskbar, not when minimizing.
According to signalapp/Signal-Desktop#5840 (comment), it is the same behaviour for Battle.net

@absidue

absidue commented Jun 3, 2026

Copy link
Copy Markdown
Member

The setting in FreeTube is explicitly designed to be minimize to system tray, not close to system tray. As for detecting wayland you can use the same approach as the existing code: https://github.com/FreeTubeApp/FreeTube/blob/development/src/main/index.js#L1163.

@Shadorc

Shadorc commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

I apologize if I wasn't clear. I wasn't suggesting that FreeTube should mimic "close to system tray" behavior. I was simply providing examples of how other Electron apps handle the "Minimize to tray" setting. If any of those apps successfully minimized to the system tray like FreeTube does on X11, it could have indicated that a solution was possible.

Thanks for the code reference. As I mentioned in my concerns here, I wasn't sure it would cover all possible scenarios, but if you're confirming it does, that's great! I'll use it to hide the setting when it's unavailable.

auto-merge was automatically disabled June 3, 2026 16:05

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 3, 2026 16:05
@Shadorc Shadorc changed the title Feat: Add tooltip to 'Minimize to system tray' setting Fix: Hide 'Minimize to system tray' setting on Wayland Jun 3, 2026
auto-merge was automatically disabled June 3, 2026 16:10

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 3, 2026 16:10
Comment thread src/main/index.js Outdated
@absidue absidue added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Jun 6, 2026
auto-merge was automatically disabled June 6, 2026 12:28

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 6, 2026 12:28
Comment thread src/renderer/components/GeneralSettings/GeneralSettings.vue
auto-merge was automatically disabled June 8, 2026 17:54

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 17:54
auto-merge was automatically disabled June 8, 2026 17:59

Head branch was pushed to by a user without write access

@Shadorc Shadorc force-pushed the feat/tray-tooltip branch from 91523c2 to 256c4da Compare June 8, 2026 17:59
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 17:59
auto-merge was automatically disabled June 8, 2026 18:09

Head branch was pushed to by a user without write access

@Shadorc Shadorc force-pushed the feat/tray-tooltip branch from 256c4da to 5e262c7 Compare June 8, 2026 18:09
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 18:09
@Shadorc

Shadorc commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure what is happening with the CI, it builds on my side and yarn run lint-fix does not show any warning/error. It indicates "Module not found" for three different modules. I've rebased on development branch with no luck.

Comment thread src/datastores/handlers/base.js Outdated
Comment thread src/renderer/components/GeneralSettings/GeneralSettings.vue Outdated
Comment thread src/preload/interface.js Outdated
auto-merge was automatically disabled June 8, 2026 20:34

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 20:34
auto-merge was automatically disabled June 8, 2026 20:48

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 20:48
@absidue

absidue commented Jun 8, 2026

Copy link
Copy Markdown
Member

Looks like you accidentally added back the yarn.lock file but the development branch switched to pnpm a few weeks ago, so you probably need to rebase again after your reverts.

auto-merge was automatically disabled June 8, 2026 20:53

Head branch was pushed to by a user without write access

@Shadorc Shadorc force-pushed the feat/tray-tooltip branch from c6b6884 to a868995 Compare June 8, 2026 20:53
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 20:53
auto-merge was automatically disabled June 8, 2026 20:56

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 8, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 'Minimize to Tray' does not work with Wayland

4 participants