[PR #1084] System tray improvements #1753

Open
opened 2026-05-05 08:01:04 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/1084
Author: @ahayzen
Created: 3/2/2021
Status: 🔄 Open

Base: masterHead: 1024-system-tray-changes


📝 Commits (5)

  • 2080784 Do not wait for tray to become available
  • 00565fa When the last window closes if there is no system tray close the app
  • 35cc645 Do not hide the window to system tray when minimising if not available
  • 3e7e7b1 Disable system tray related settings if not available
  • d0df871 Ensure that window is not hidden with no system tray after startup

📊 Changes

6 files changed (+65 additions, -40 deletions)

View changed files

📝 src/gui/src/MainWindow.cpp (+40 -1)
📝 src/gui/src/MainWindow.h (+3 -0)
📝 src/gui/src/QBarrierApplication.cpp (+15 -0)
📝 src/gui/src/QBarrierApplication.h (+3 -0)
📝 src/gui/src/SettingsDialog.cpp (+4 -0)
📝 src/gui/src/main.cpp (+0 -39)

📄 Description

  • Do not block at startup for a period of time when there is no system tray
  • if there is no system tray, quit when the last window closes
  • If there is no system tray, disable the settings for autohide / minimise to tray

I have changed how the timer works for ensuring that the user does not get stuck with a hidden window. Instead of always waiting for the system tray to become available before deciding if to disable autohide or show the window. Now we perform showing the window or starting hidden. If we start hidden and the systemtray was not available, we then wait a period of time to check it's not being slow at becoming available, then we force the window to show.

As you can see in the table below this removes the potential for waiting at startup from the 4 different startup procedures to just 1. And this use case is an unlikely scenario now that the settings are disabled if the system tray isn't available (the user would have had to enable autohide when the system tray was available and then disable the system tray on their system).

Scenario Before After
autohide=false, systemtray=true Wait for system tray to become available (success), then show the window Show the window
autohide=true, systemtray=true Wait for system tray to become available (success), then start with hidden window Start with hidden window
autohide=false, systemtray=false Wait for system tray to become available (fails), then show the window Show the window
autohide=true, systemtray=false Wait for system tray to become available (fails), then show the window Start with the window hidden, wait a period of time to check if the system tray becomes available (fails), then show the window

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/1084 **Author:** [@ahayzen](https://github.com/ahayzen) **Created:** 3/2/2021 **Status:** 🔄 Open **Base:** `master` ← **Head:** `1024-system-tray-changes` --- ### 📝 Commits (5) - [`2080784`](https://github.com/debauchee/barrier/commit/2080784dd109179adfae2aabe484c0830ac285ac) Do not wait for tray to become available - [`00565fa`](https://github.com/debauchee/barrier/commit/00565fa7eac050f19f71cdd407abbb51c347bf6c) When the last window closes if there is no system tray close the app - [`35cc645`](https://github.com/debauchee/barrier/commit/35cc645637b11579cf1723d1d7706b9a0ace0b17) Do not hide the window to system tray when minimising if not available - [`3e7e7b1`](https://github.com/debauchee/barrier/commit/3e7e7b1af3215965430cdda60682a8bdc1e98526) Disable system tray related settings if not available - [`d0df871`](https://github.com/debauchee/barrier/commit/d0df87137336f4ac61872cb4857478e2a827cba4) Ensure that window is not hidden with no system tray after startup ### 📊 Changes **6 files changed** (+65 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/gui/src/MainWindow.cpp` (+40 -1) 📝 `src/gui/src/MainWindow.h` (+3 -0) 📝 `src/gui/src/QBarrierApplication.cpp` (+15 -0) 📝 `src/gui/src/QBarrierApplication.h` (+3 -0) 📝 `src/gui/src/SettingsDialog.cpp` (+4 -0) 📝 `src/gui/src/main.cpp` (+0 -39) </details> ### 📄 Description * Do not block at startup for a period of time when there is no system tray * if there is no system tray, quit when the last window closes * If there is no system tray, disable the settings for autohide / minimise to tray I have changed how the timer works for ensuring that the user does not get stuck with a hidden window. Instead of always waiting for the system tray to become available before deciding if to disable autohide or show the window. Now we perform showing the window or starting hidden. If we start hidden and the systemtray was not available, we then wait a period of time to check it's not being slow at becoming available, then we force the window to show. As you can see in the table below this removes the potential for waiting at startup from the 4 different startup procedures to just 1. And this use case is an unlikely scenario now that the settings are disabled if the system tray isn't available (the user would have had to enable autohide when the system tray was available and then disable the system tray on their system). | Scenario | Before | After | | ------------- | ------------- | ------------- | | autohide=false, systemtray=true | Wait for system tray to become available (success), then show the window | Show the window | | autohide=true, systemtray=true | Wait for system tray to become available (success), then start with hidden window | Start with hidden window | | autohide=false, systemtray=false | Wait for system tray to become available (fails), then show the window | Show the window | | autohide=true, systemtray=false | Wait for system tray to become available (fails), then show the window | Start with the window hidden, wait a period of time to check if the system tray becomes available (fails), then show the window | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror added the
pull-request
label 2026-05-05 08:01:04 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1753
No description provided.