-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Main window doesn't receive focus when Mumble-specific Windows notification is clicked #5701
Comments
I know that I have tried bringing something to the foreground on Windows on different occasions and the result was always that it is not possible as Windows places very strict rules on when this is allowed. However, in this specific case, it might indeed work as here Mumble should be the kast application to receive an input event (the click on the notification), so I guess it would be worth a try. |
Was browsing the source code and realized that you already handle the signal that the Qt framework emits whenever the notification is clicked. mumble/src/mumble/MainWindow.cpp Line 173 in 74faaba
Seems to be exactly what's happening, though I'm sure there has to be a way to activate the window properly seeing as other applications can. Not going to dig further though as I'm out of my depths here. |
Ah yeah then this is exactly the behavior that I had in mind. In this case I'll just close this issue as an "upstream bug" where "upstream" in this case is Windows itself. If even Qt themselves state that this won't work, then I don't see a big chance of use somehow circumventing Windows's restrictions here. |
Not sure I agree that this is an upstream bug. I made a test C# win forms project, created a simple form with one TextBox and one NotifyIcon. Form class was something along the lines of (click/resize/activate/etc. event handlers simply bind to the functions outlined below so not including the rest of the class): public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
notifyIcon1.Icon = Properties.Resources.Icon1;
notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
notifyIcon1.BalloonTipText = "Test!";
}
private void Form1_Resize(object sender, EventArgs e)
{
if(this.WindowState == FormWindowState.Minimized)
{
Hide();
notifyIcon1.Visible = true;
System.Threading.Thread.Sleep(2000);
notifyIcon1.ShowBalloonTip(5000);
}
}
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
ActivateMainWindow();
}
private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e)
{
ActivateMainWindow();
}
private void Form1_Activated(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + " " + DateTime.Now + " - " + this.Name + " activated\r\n";
}
private void Form1_Deactivate(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + " " + DateTime.Now + " - " + this.Name + " deactivated\r\n";
}
private void ActivateMainWindow()
{
Show();
this.WindowState = FormWindowState.Normal;
notifyIcon1.Visible = false;
}
} As expected, clicking the notification that is shown when calling Digging deeper it seems that the issue might specifically be: mumble/src/mumble/MainWindow.cpp Line 3501 in 74faaba
If you disable the option of hiding Mumble to the system tray when minimized, minimize Mumble then clicking on a notification, Mumble restores itself and is now the top-most window (even if it's still not activated). Definitely better than before because at least now the main Mumble window is in the foreground. I don't have a C++ compiler handy to test but I feel like void MainWindow::showRaiseWindow() {
show();
// don't need a conditional check for being minimized since we're always removing the Qt::WindowMinimized flag
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
raise();
activateWindow();
} That should hopefully:
|
I'm afraid that messing with the minimize to tray feature in any way will become an enormous undertaking in and of itself as this is a complete mess that tends to create infinite loops and whatnot 👀 It might be worth a try though |
I gave this a shot a couple weeks ago, using some ideas from other programs that use the Qt framework and correctly bring a window to focus, but didn't have any luck solely changing what More reading: |
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
Hi, I investigated this in #6466 and there are three issues here:
and most importantly
Meaning that if there is no foreground window (focus on the desktop maybe?) this might work etc. Anyway, in #6466 I modified the However, the issue as stated here (no focus on notification click) can not be fixed by us and would require a change in the Windows compositor/window manager. |
Every day. 😉 Happy to test. |
@Snowknight26 That would be really great! This is a Mumble Windows build created by our CI pipeline: I assume you are currently using 1.5.634, which means there should be no problem in upgrading to the test build. If you are coming from 1.4.x you might want to backup your settings file before upgrading in case the experimental build breaks something, because the settings will be migrated to a JSON file from 1.4 -> 1.5. Please check, if the tray icon behaves "as correct as possible" in this experimental build 😅 I have also added a few questions to the bottom of #6466 which should ideally all be answered with "yes" |
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
The old tray icon implementation was very old and contained a lot of workaround for things that probably are no longer an issue. Furthermore, the event loop was modified in a way such that it could end up in an infinite loop draining CPU time and rendering Mumble unusable. Based on the new Qt5 implementation, this commit introduces a complete rewrite of the tray icon. The following things should be noted: * We assume the information in the Qt documentation [1] is valid. This means that all versions of Windows, all Linux window managers/compositors that implement the d-bus StatusNotifierItem specification, and all versions of macos support the functionality of QSystemTrayIcon and its notification system. That means we can drop the platform-specific code branches and handle messages directly with QSystemTrayIcon::sendMessage. This should for example also be true for recent versions of Gnome, which do not have an actual system tray, but implement the d-bus StatusNotifierItem specification. Therefore, we can actually merge and simplify the notification code for Windows and Unix*. * With regards to the bullet point above, we only limit the "hide to tray" functionality behind QSystemTrayIcon::isSystemTrayAvailable (because otherwise you would not get the Mumble window back without binding a shortcut first). Other code branches that were previously limited when isSystemTrayAvailable returned false were removed. According to Qt, the QSystemTrayIcon code does not actually care if a system tray is available and will even retroactively add itself if a tray becomes available after the application was started. * On (X)Wayland, the minimize button in the window frame does not trigger a minimize change event. This means that users with such a system may only be able to "hide to tray" by 1) pressing the close button in the window frame and enabling "minimize instead of close" 2) clicking the tray icon or the tray icon hide action or 3) binding a shortcut to hide the window. This is either a bug or a deliberate decision by Qt or Wayland and we have no way to do anything about that. (QTBUG-74310) * The "messageClicked" event is buggy in Qt on some platforms. That means that clicking the system notification spawned by Mumble via QSystemTrayIcon::sendMessage will (on some systems) never trigger anything especially not showing and activating the window. This is a long-standing bug in Qt (QTBUG-87329), but we have absolutely no way to work around this. The event is correctly hooked up in Mumble and if this is ever fixed in Qt, this will start working again automatically. * The tray icon has been redesigned according to state-of-the-art tray icon design guidelines [2]. Which basically just means: 1) d9a2d47 has been reverted to provide the user with a consistent menu 2) The main action of the tray icon (toggle show/hide) is the first entry in the context menu and the default action when the icon is clicked and 3) the TalkingUI toggle action was added. Actions for double and middle mouse clicks were removed as they might have contributed to infinite loops. * There is no way in Windows to show and activate a window that is not part of the current active process. If you have Mumble running in the background and receive a message, we can not raise the Window without you clicking the Mumble taskbar item or tray icon yourself. This is deliberate by Microsoft and can and should not be circumvented. (mumble-voip#5701) * This also fixes the case where the Mumble MainWindow would disappear when pressing "OK" in the settings dialog. This happened because users would have "minimize to tray" and "minimize on close" enabled. [1] https://doc.qt.io/qt-5/qsystemtrayicon.html#details https://doc.qt.io/qt-6/qsystemtrayicon.html#details [2] https://learn.microsoft.com/en-us/windows/win32/uxguide/winenv-notification Fixes mumble-voip#1486 Fixes mumble-voip#3028 Fixes mumble-voip#3722 Fixes mumble-voip#3977 Fixes mumble-voip#3999 Fixes mumble-voip#5012
Description
Most programs that can generate a Windows notification have their main window activated whenever the notification is clicked.
Mumble, on the other hand, seems to be the only program that activates the main window in the background. As a result, if Mumble is either minimized to the system tray or its main window is not in focus, clicking on the notification does not bring it to the foreground and focus the main window.
This is especially inconvenient when a maximized window is already in focus, as after clicking on the notification you then also have to click on Mumble in the taskbar (or Alt+Tab, etc.).
I've added a video showing the reproduction steps and issue in action.
Steps to reproduce
Mumble version
1.4.230
Mumble component
Client
OS
Windows
Reproducible?
Yes
Additional information
No response
Relevant log output
No response
Screenshots
2022-05-26_00-25-03.mp4
The text was updated successfully, but these errors were encountered: