close
The Wayback Machine - https://web.archive.org/web/20220311074427/https://github.com/obsproject/obs-studio/pull/6057
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Fix show/hide toggle with minimize to taskbar #6057

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cg2121
Copy link
Contributor

@cg2121 cg2121 commented Mar 1, 2022

Description

If the user would minimize to tray instead of taskbar, the
window would flash when clicking show in the tray menu, and
the preview would be disabled. This would only happen on Linux.

Motivation and Context

Fixes #3418

How Has This Been Tested?

  • Set OBS to minimize to system tray instead of taskbar
  • Clicked show in tray menu to make sure everything worked as expected

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM
Copy link
Collaborator

@WizardCM WizardCM commented Mar 1, 2022

Has this change been tested on all 3 platforms, or just Linux? And on Linux, which DE?

@cg2121
Copy link
Contributor Author

@cg2121 cg2121 commented Mar 1, 2022

Just Linux on Ubuntu 21.10.

@cg2121
Copy link
Contributor Author

@cg2121 cg2121 commented Mar 2, 2022

Tested now on Windows 10 without problems

@WizardCM
Copy link
Collaborator

@WizardCM WizardCM commented Mar 5, 2022

Commit title needs improvement.

@WizardCM WizardCM self-requested a review Mar 5, 2022
If the user would minimize to tray instead of taskbar, the
window would flash when clicking show in the tray menu, and
the preview would be disabled. This would only happen on Linux.
@cg2121 cg2121 force-pushed the fix-systray-bug branch from 522edaa to 5331d83 Mar 6, 2022
@cg2121 cg2121 changed the title UI: Fix system tray bug UI: Fix show/hide toggle with minimize to taskbar Mar 6, 2022
@cg2121
Copy link
Contributor Author

@cg2121 cg2121 commented Mar 6, 2022

Title has been updated.

Copy link
Collaborator

@WizardCM WizardCM left a comment

Verified this fixes the bug on Ubuntu 20.04.

@@ -8902,9 +8903,10 @@ void OBSBasic::SetShowing(bool showing)

if (showHide)
showHide->setText(QTStr("Basic.SystemTray.Show"));
QTimer::singleShot(250, this, SLOT(hide()));
QTimer::singleShot(0, this, SLOT(hide()));
Copy link
Collaborator

@WizardCM WizardCM Mar 9, 2022

Choose a reason for hiding this comment

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

Does this actually still need to be in a QTimer if it's being triggered at a delay of 0, or is this more "rather not break anything unnecessarily" territory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants