Skip to content
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

New geometry only saved when main window is closed #45

Closed
stefanb2 opened this issue Sep 16, 2015 · 7 comments
Closed

New geometry only saved when main window is closed #45

stefanb2 opened this issue Sep 16, 2015 · 7 comments
Assignees

Comments

@stefanb2
Copy link
Collaborator

Try this

  • start Qt-SESAM
  • resize main window
  • system tray icon menu "Quit" to exit program
  • start Qt-SESAM

It will still show the old main window geometry.

If you CLOSE the main window and then exit the application, it works fine.

@607011
Copy link
Owner

607011 commented Sep 16, 2015

Oops! I'll check on that.

@607011 607011 added the bug label Sep 16, 2015
@stefanb2
Copy link
Collaborator Author

$ fgrep geometry .config/ct/QtSESAM.ini
geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\b7\0\0\0/\0\0\f\x8e\0\0\x3g\0\0\b;\0\0\0L\0\0\f\xed\0\0\x3j\0\0\0\x1\0\0\0\0\a\x80)"

Resize window (-> same values)

$ fgrep geometry .config/ct/QtSESAM.ini
geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\b7\0\0\0/\0\0\f\x8e\0\0\x3g\0\0\b;\0\0\0L\0\0\f\xed\0\0\x3j\0\0\0\x1\0\0\0\0\a\x80)"

Close window (-> new values)

$ fgrep geometry .config/ct/QtSESAM.ini
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\b\xfd\0\0\0\xcc\0\0\r\xb7\0\0\x4\v\0\0\t\x1\0\0\0\xe9\0\0\r\xb3\0\0\x4\a\0\0\0\x1\0\0\0\0\a\x80)

I guess you would need to explicitly call close window on the main window when exiting the program?

@607011
Copy link
Owner

607011 commented Sep 16, 2015

The Windows version behaves as expected: Regardless of whether you close the application via File/Exit from the main menu or by selecting Quit from the tray icon, the geometry is saved and restored correctly.

Weird!

@stefanb2
Copy link
Collaborator Author

This is side-effect of issue #44 and not working close() slot. Closing this one.

@stefanb2
Copy link
Collaborator Author

Actually let's keep issue #44 open and close this one for fixing the Exit issue.

@stefanb2 stefanb2 reopened this Sep 16, 2015
@stefanb2
Copy link
Collaborator Author

From 3d86619d385a35604e9821b53891b6ad87560952 Mon Sep 17 00:00:00 2001
From: Stefan Becker <chemobejk@gmail.com>
Date: Wed, 16 Sep 2015 20:25:04 +0300
Subject: [PATCH] mainwindow: hide tray icon in closeEvent()

At least on Linux (or KDE Plasma?) the application must hide the system
tray icon in main window closeEvent() in order for Qt to shut down the
application.

Resolves issue #45
---
 Qt-SESAM/mainwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Qt-SESAM/mainwindow.cpp b/Qt-SESAM/mainwindow.cpp
index 05f8a52..0a782b2 100644
--- a/Qt-SESAM/mainwindow.cpp
+++ b/Qt-SESAM/mainwindow.cpp
@@ -320,6 +320,7 @@ void MainWindow::closeEvent(QCloseEvent *e)
   auto prepareExit = [this]() {
     d_ptr->masterPasswordDialog->close();
     d_ptr->optionsDialog->close();
+    d_ptr->trayIcon.hide();
     saveSettings();
     invalidatePassword(false);
     d_ptr->keyGenerationFuture.waitForFinished();
-- 
2.4.3

607011 pushed a commit that referenced this issue Sep 17, 2015
At least on Linux (or KDE Plasma?) the application must hide the system
tray icon in main window closeEvent() in order for Qt to shut down the
application.

Resolves issue #45
@607011
Copy link
Owner

607011 commented Sep 17, 2015

Resolved by commit ceda75e

@607011 607011 closed this as completed Sep 17, 2015
stefanb2 added a commit that referenced this issue Sep 17, 2015
At least on Linux (or KDE Plasma?) the application must hide the system
tray icon in main window closeEvent() in order for Qt to shut down the
application.

Resolves issue #45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants