mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Merge pull request #2581 from nextcloud/ensure_systray_window_doesnt_prevent_windows_session_close
Ensure we quickly show/hide the systray window on startup
This commit is contained in:
commit
2bcc99792d
3 changed files with 12 additions and 0 deletions
|
@ -206,6 +206,15 @@ void Systray::positionWindow(QQuickWindow *window) const
|
|||
window->setPosition(position);
|
||||
}
|
||||
|
||||
void Systray::forceWindowInit(QQuickWindow *window) const
|
||||
{
|
||||
// HACK: At least on Windows, if the systray window is not shown at least once
|
||||
// it can prevent session handling to carry on properly, so we show/hide it here
|
||||
// this shouldn't flicker
|
||||
window->show();
|
||||
window->hide();
|
||||
}
|
||||
|
||||
QScreen *Systray::currentScreen() const
|
||||
{
|
||||
const auto screens = QGuiApplication::screens();
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
Q_INVOKABLE void setOpened();
|
||||
Q_INVOKABLE void setClosed();
|
||||
Q_INVOKABLE void positionWindow(QQuickWindow *window) const;
|
||||
Q_INVOKABLE void forceWindowInit(QQuickWindow *window) const;
|
||||
|
||||
signals:
|
||||
void currentUserChanged();
|
||||
|
|
|
@ -24,6 +24,8 @@ Window {
|
|||
Accessible.role: Accessible.Application
|
||||
Accessible.name: qsTr("Nextcloud desktop main dialog")
|
||||
|
||||
Component.onCompleted: Systray.forceWindowInit(trayWindow)
|
||||
|
||||
// Close tray window when focus is lost (e.g. click somewhere else on the screen)
|
||||
onActiveChanged: {
|
||||
if(!active) {
|
||||
|
|
Loading…
Reference in a new issue