andrew-bibb / cmst

QT GUI for Connman
174 stars 37 forks source link

close cmst when close ("x") button pressed #169

Closed lllars closed 7 years ago

lllars commented 7 years ago

I guess most users of this program run it with a system tray, and so want the program to keep running. I run openbox without a system tray and would prefer cmst to close when I'm done with it. I can click the "exit" button and it does just that. But, if I forget and hit the "x" in the titlebar, the cmst process remains running, and the window dissapears (with no way of getting it back).

Is it possible to add an option (to preferences or on the command line), so the program can be set to exit when closed? Maybe this behavior should be part of the "--disable-tray-icon" option?

andrew-bibb commented 7 years ago

I'm pretty sure I can do this. I do not quit on last window close (controlbox.cpp line 136). Comments in the code before that explain why. It indeed is mainly for people running from a systemtray, so it will be fairly simple to put in a systemtray check and if none found bypass that command.

andrew-bibb commented 7 years ago

I just updated code here at GitHub which should (I hope) address this. Could you check it and see if it does what you need. The 'X' button is window manager dependent and on the WM I'm running (i3) there are no minimize, maximize, or close window decorations. Makes it hard for me to check things like this, but I've pretty much determined that this fix does not break what I had it in there for. So if it does what you need we'll close this one out.

Thank you for suggesting the improvement.

A-

lllars commented 7 years ago

Thanks! The fix works great.