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

Linux: duplicate "Quit" entry in system tray icon menu #44

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

Linux: duplicate "Quit" entry in system tray icon menu #44

stefanb2 opened this issue Sep 16, 2015 · 8 comments
Labels

Comments

@stefanb2
Copy link
Collaborator

On my Fedora 22 box with KDE Plasma 5 the system tray icon menu looks like this

Uploading QtSESAM-tray-menu-KDEPlasma.png…

As you can see there is a duplicate "Quit" entry at the end. This is not generated by Qt-SESAM, but automatically by the system (it's translation changes when I switch languages).

I'm not sure how to solve this. If this is the case for every Linux user, but not Windows user, then I would suggest to flag the generation of the "Quit" entry with #ifdef WIN32 in the code.

@stefanb2
Copy link
Collaborator Author

The one generated by the system (the lower entry with icon) quits the program correctly. But it causes issue #45.

The one generated by QT-SESAM (the upper entry without icon) only closes the main window.

@607011 607011 added the explore label Sep 16, 2015
@607011 607011 self-assigned this Sep 16, 2015
@stefanb2
Copy link
Collaborator Author

As far as I can tell from the source code, the main menu entry File -> Exit and the system tray icon menu entry Quit are connected to the main window slot close(). I.e. they only close the main window, but do not exit the application.

The system generated entry on the system tray icon menu causes this dialog:

Uploading QtSESAM-tray-menu-Exit-Dialog.png…

which I can't find in the source code. So I assume this is a "force application" dialog from the system.

IMHO a real "exit" is missing in the Qt-SESAM code

@stefanb2
Copy link
Collaborator Author

ah damn... wrong button. This is NOT closed :-(

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

OK, somehow the PNG uploads got lost. Trying again:

qtsesam-tray-menu-exit-dialog

qtsesam-tray-menu-kdeplasma

@607011
Copy link
Owner

607011 commented Sep 16, 2015

If close() is called on the MainWindow the main loop exits, thus ending the application. That's the theory and works on Windows in practice. Regarding the Qt docs this is the desired behavior of close() and should be the same on other platforms. Should

@stefanb2
Copy link
Collaborator Author

I checked the documentation: your mainwindow code looks correct. Except maybe the QMainWindow::closeEvent() calls.

I even connected the exit with the closeAllWindows slot on qApp and it still doesn't work.

So my assumption is that the problem is in QApplication, not your main window code. I.e. the application doesn't exit when the last window is closed.

@607011
Copy link
Owner

607011 commented Sep 16, 2015

Regarding the extra "Quit" tray item: It doesn't appear on every Linux desktop. So it leads to nothing to #ifdef WIN32 the code section that inserts the "Quit" action :-(

@607011
Copy link
Owner

607011 commented Feb 10, 2016

Obviously some Linux desktops add a quit button by themselves. Won't do anything about it. Thus closing this issue.

@607011 607011 closed this as completed Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants