mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Fix restore to maximize state on tray click
This commit is contained in:
parent
2ba4270cbb
commit
ab21722653
@ -151,7 +151,6 @@ MainWindow::MainWindow(QWidget *p) : QMainWindow(p) {
|
||||
banEdit = NULL;
|
||||
userEdit = NULL;
|
||||
tokenEdit = NULL;
|
||||
bNoHide = false;
|
||||
|
||||
uiContextSession = ~0;
|
||||
iContextChannel = -1;
|
||||
@ -392,13 +391,12 @@ void MainWindow::hideEvent(QHideEvent *e) {
|
||||
e->ignore();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifdef Q_OS_UNIX
|
||||
if (! qApp->activeModalWidget() && ! qApp->activePopupWidget())
|
||||
#endif
|
||||
if (g.s.bHideTray && !bNoHide && qstiIcon->isSystemTrayAvailable())
|
||||
qApp->postEvent(this, new QEvent(static_cast<QEvent::Type>(TI_QEVENT)));
|
||||
if (g.s.bHideTray && qstiIcon->isSystemTrayAvailable() && e->spontaneous())
|
||||
QMetaObject::invokeMethod(this, "hide", Qt::QueuedConnection);
|
||||
QMainWindow::hideEvent(e);
|
||||
#endif
|
||||
}
|
||||
@ -659,18 +657,14 @@ void MainWindow::setOnTop(bool top) {
|
||||
wf |= Qt::WindowStaysOnTopHint;
|
||||
else
|
||||
wf &= ~Qt::WindowStaysOnTopHint;
|
||||
bNoHide = true;
|
||||
setWindowFlags(wf);
|
||||
show();
|
||||
bNoHide = false;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setupView(bool toggle_minimize) {
|
||||
bool showit = ! g.s.bMinimalView;
|
||||
|
||||
bNoHide = true;
|
||||
|
||||
// Update window layout
|
||||
Settings::WindowLayout wlTmp = g.s.wlWindowLayout;
|
||||
switch (wlTmp) {
|
||||
@ -779,7 +773,6 @@ void MainWindow::setupView(bool toggle_minimize) {
|
||||
|
||||
show();
|
||||
activateWindow();
|
||||
bNoHide = false;
|
||||
}
|
||||
|
||||
void MainWindow::on_qaServerConnect_triggered(bool autoconnect) {
|
||||
@ -2245,8 +2238,9 @@ void MainWindow::on_Icon_activated(QSystemTrayIcon::ActivationReason reason) {
|
||||
|
||||
if (reason == QSystemTrayIcon::Trigger) {
|
||||
if (! isVisible()) {
|
||||
show();
|
||||
if (isMinimized())
|
||||
if (isMaximized())
|
||||
showMaximized();
|
||||
else
|
||||
showNormal();
|
||||
activateWindow();
|
||||
} else {
|
||||
|
||||
@ -98,8 +98,6 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
|
||||
bool bSuppressAskOnQuit;
|
||||
bool bAutoUnmute;
|
||||
|
||||
bool bNoHide;
|
||||
|
||||
unsigned int uiContextSession;
|
||||
int iContextChannel;
|
||||
|
||||
|
||||
@ -2115,12 +2115,10 @@ void OverlayClient::hideGui() {
|
||||
if (g.ocIntercept == this)
|
||||
g.ocIntercept = NULL;
|
||||
|
||||
g.mw->bNoHide = true;
|
||||
foreach(QWidget *w, widgetlist) {
|
||||
if (bWasVisible)
|
||||
w->show();
|
||||
}
|
||||
g.mw->bNoHide = false;
|
||||
|
||||
setupScene(false);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user