Skip to content

Added hide to tray on minimize option#6915

Merged
FreeTubeBot merged 55 commits into
FreeTubeApp:developmentfrom
Devenor:tray
Aug 16, 2025
Merged

Added hide to tray on minimize option#6915
FreeTubeBot merged 55 commits into
FreeTubeApp:developmentfrom
Devenor:tray

Conversation

@Devenor
Copy link
Copy Markdown
Contributor

@Devenor Devenor commented Feb 24, 2025

Added hide to tray on minimize option

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #59

Description

Adds optional hide to system tray behaviour on minimizing the main window. The settings have an option to enable or disable it in the general section. The tray icon has a small menu for closing the app or opening the window again, and it can be opened by clicking on the icon too.

Screenshots

Screenshot is outdated, only hide to tray on minimize exists now.
image

image

Testing

  • Go to Settings -> General and enable Minimize to system tray.
  • When minimizing a window, the window will hide and a tray icon will appear.
  • [Only on Windows] If there's only one window in the tray, left clicking the tray will open the window and the tray will disappear.
  • Right clicking the tray will show a menu with an option to quit the app, and one submenu for each minimized window.
  • Clicking the submenu will show one option to open the window and another to close it. When clicking an option, the submenu will disappear.
  • If there are no more windows minimized, on Windows the tray will disappear, and on Linux it will remain with just the quit option.
  • When a window is shown from the tray, it will retain its original size and position.
  • When disabling the setting, if there are minimized windows they'll appear minimized in the taskbar.
  • This setting is not avaliable for MacOS.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: v0.23.2 Beta

Additional context

@github-actions github-actions Bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Feb 24, 2025
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 24, 2025 22:48
auto-merge was automatically disabled February 24, 2025 23:12

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 24, 2025 23:12
@absidue
Copy link
Copy Markdown
Member

absidue commented Feb 25, 2025

Please fix the build and revert all unrelated changes such as the dependency additions, there is no need to manually extract anything from the asar file and the translations are overkill at the moment (especially pulling in multiple dependencies just to translate 2 strings).

Even after the corrections there are still open questions such as how to handle multiple windows.

@absidue absidue added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Feb 25, 2025
auto-merge was automatically disabled February 25, 2025 18:18

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 25, 2025 18:18
auto-merge was automatically disabled February 25, 2025 18:22

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 25, 2025 18:23
@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Feb 25, 2025

Thanks for the review, I reverted the new dependencies (I didn't know you could read asar directly from node fs! It's much better now). About the i18n, if needed maybe we could send the translated text via IPC and recreate the tray.

As for how to handle multiple windows, I didn't know you could have more than one, is there some kind of setting for that?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

auto-merge was automatically disabled March 3, 2025 21:02

Head branch was pushed to by a user without write access

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2025

Conflicts have been resolved. A maintainer will review the pull request shortly.

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 3, 2025 21:02
@absidue
Copy link
Copy Markdown
Member

absidue commented Mar 3, 2025

Looks like you may have mistakenly used npm instead of yarn to install the dependencies and pushed a package-lock.json file, additionally there seem to be changes to the yarn.lock file which shouldn't really be there as the dependencies are no longer changing in this PR.

auto-merge was automatically disabled March 3, 2025 21:38

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 3, 2025 21:38
auto-merge was automatically disabled March 3, 2025 21:43

Head branch was pushed to by a user without write access

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Jun 11, 2025

Well the Ubuntu VM is configured with low resources so i gave it max resources but that didnt improve the situation :(

Who knows then... I've already filed the report, let's see what they say.

In the meantime, would you be OK with trying to merge this increasing the timer or disabling it for Linux?

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Jun 12, 2025

@efb4f5ff-1298-471a-8973-3d47447115dc do you mind if I attach one of your videos showing the bug to the report? They are asking for one. Or you could do it yourself if you want, I won't be able until tomorrow.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

@Devenor go ahead and use the clips you need

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

Hi @Devenor i noticed that the Electron report has been shot down but they did leave a suggestion on how to (maybe?) make it work. Is that useful to you?

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Jun 28, 2025

Hi @efb4f5ff-1298-471a-8973-3d47447115dc, I was hoping they'd respond to our replies, but I guess that won't happen... I’ll try in the next few days to see if what they suggested can actually be done.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

I was also hoping for that tbh :(

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Jun 29, 2025

After a bit of reading and testing, I think what they are suggesting is too complex to be worth it. But I found a more robust way to implement my workaround without the need of timers that seems promising, could you please test it? There shouldn't be any flickering either.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

There is a flicker sometimes to me that feels acceptable but i know that it could potentially trigger seizures for people with photosensitive epilepsy :sigh:

VirtualBoxVM_SLq0t1wzCz.mp4

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Jul 10, 2025

@efb4f5ff-1298-471a-8973-3d47447115dc can you please try again? I've found another workaround and after trying many times, I don't see any flicker. It's cleaner than the last one, too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed all linux vms with flying colors!

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Jul 24, 2025

Can we finally merge this?

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

@Devenor the others still need to review this but everybody is time constraint right now with life stuff. Please be patient

@PikachuEXE
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with macOS & windows (but I don't use this feature regularly, I have no other multi-window app with minimize to tray

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

Copy link
Copy Markdown
Member

@absidue absidue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally everything seems to be working correctly, there are a few issues with the code such as commented out debug code and none of the code getting removed in the macOS build despite not being used, but as this pull request has been going on for so long and you have stuck with us to get it working I am willing to look past that and get this merged.

Thank you very much for your pull request, I am sorry that it took this long and I hope it hasn't discouraged your from wanting to contribute to FreeTube again in the future! LGTM :D

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Aug 19, 2025

Thanks a lot guys! Sorry about the code having a few flaws, I'd be happy to change it, but I see you've already taken care of it. I'll try to keep in mind those changes for my next contribution.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

@Devenor would you be interested in doing a followup PR. I noticed from my day to day use that if i want to open another instance of FT i need to open reopen my minimized instance from tray -> Now i can open an instance -> Minimize the instance to tray again -> use the newly opened instance

I think the tray would benefit from a option to open an instance directly similar to #7049

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Sep 1, 2025

Sure, looks like a nice feature, I'm in!

But if I'm not mistaken, #7049 just applies to Windows and MacOS, is there any issue with Linux?

@absidue
Copy link
Copy Markdown
Member

absidue commented Sep 1, 2025

Adding the button to the tray menu on Linux should be fine, the issue with adding it to the app icon menu on Linux was that some distros weren't showing FreeTube's button but were instead showing their own one that doesn't work with FreeTube: #7049 (comment)

@Devenor
Copy link
Copy Markdown
Contributor Author

Devenor commented Sep 1, 2025

I see, usual Linux stuff... so, assuming it works in the tray, would you prefer to have the option there but not in the taskbar, rather than not having it at all? I guess it's better than nothing, but it could be a bit weird.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

I prefer to have it added to the tray

@DankestFke
Copy link
Copy Markdown

Can we have close for minimise to tray?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Tray and notifications

7 participants