Hotfix #304: Compositing glitches when restoring from tray #307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves #304.
Description
When "Hide window to system tray when minimized" and "Minimize window at application startup" are enabled, restoring the window from the tray causes compositing problems on Ubuntu Unity/Compiz.
Most of those glitches have already been solved as a result of #276 which properly sets the minimize flag on the window before hiding it, but that didn't apply at startup time.
With this fix, KeePassXC doesn't try to show the main window anymore, only to minimize it right after if both options are set. This not only gets rid of artifacts on Ubuntu, but also prevents the window from flashing up for a split second after starting KeePassXC.
I also smuggled another small fix into this PR which solves a timing issues which sometimes causes the window to not be shown properly when restoring it from the tray on Linux (at the cost of not having the window manager's restore animation anymore).
How Has This Been Tested?
This was tested on a physical Ubuntu 16.04 machine with Unity and the glitches are gone.
It was also tested on the following non-affected platforms to ensure no regressions were introduced:
Mac was not tested because it doesn't have a tray.
Types of changes
Checklist: