Cope with focusWidget/activeWindow returning windows that are minimized.

This commit is contained in:
Felix Geyer 2015-10-10 11:22:17 +02:00
parent ebeedba072
commit 840642394f
2 changed files with 3 additions and 2 deletions

View File

@ -208,7 +208,7 @@ int AutoTypePlatformX11::platformEventFilter(void* event)
&& m_currentGlobalKey
&& xevent->xkey.keycode == m_currentGlobalKeycode
&& (xevent->xkey.state & m_modifierMask) == m_currentGlobalNativeModifiers
&& !QApplication::focusWidget()
&& (!QApplication::activeWindow() || QApplication::activeWindow()->isMinimized())
&& m_loaded) {
if (xevent->type == KeyPress) {
Q_EMIT globalShortcutTriggered();

View File

@ -575,10 +575,11 @@ void MainWindow::trayIconTriggered(QSystemTrayIcon::ActivationReason reason)
void MainWindow::toggleWindow()
{
if (QApplication::activeWindow() == this) {
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
hide();
}
else {
ensurePolished();
setWindowState(windowState() & ~Qt::WindowMinimized);
show();
raise();