Skip to content
Permalink
Browse files

MainWindow: only perform changeEvent's hide-in-tray logic if there is…

… a system tray available.

Previously, this would hide Mumble when switching workspaces in XMonad, and possibly other WMs
without a default notification area/system tray.

What happens when you switch to another workspace in XMonad is:

1. Mumble's MainWindow gets a "spontaneous" hideEvent. The window is now minimized.
2. Mumble's MainWindow gets a changeEvent, because of the state change from shown to minimized.
3. Because the window is minimized (via a spontaneous hide event), isMinimized() is now true.
   Mumble would then, before this change, invoke hide(). This causes the window to be non-visible:
   calling hide() is equivalent to calling setVisible(false).

This hidden state is never restored, not even for a spontaneous show event, so there is no
way, other than restarting Mumble, to get the MainWindow to show again.

This commit avoids calling hide() in changeEvent() on systems where no system tray is available,
such as XMonad.

See #1679
  • Loading branch information...
mkrautz committed Apr 15, 2017
1 parent 46462cd commit 224d0f3f0f54bebb60dcc19be812ee7323106684
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/mumble/MainWindow.cpp
@@ -512,7 +512,7 @@ void MainWindow::changeEvent(QEvent *e) {
// So, let's not do it on macOS.

#else
if (isMinimized() && g.s.bHideInTray) {
if (isMinimized() && qstiIcon->isSystemTrayAvailable() && g.s.bHideInTray) {
// Workaround http://qt-project.org/forums/viewthread/4423/P15/#50676
QTimer::singleShot(0, this, SLOT(hide()));
}

0 comments on commit 224d0f3

Please sign in to comment.
You can’t perform that action at this time.