Qtox: New settings not saved without clean exit on Windows.

Created on 6 Jul 2015  Â·  9Comments  Â·  Source: qTox/qTox

When qTox (64-bit Nightly) was installed on my Windows 8.1 (x86_64) machine, I set up my user and configured some basic settings such as icon color. When I shutdown Windows without
(properly) closing qTox, it forgot the changes made in "settings". However, it DID remember my username and avatar, as well as the other person's info that I was chatting with.

So basically, the changes made in SETTINGS were not saved when the app was closed by the OS (I did NOT tell Windows to force-close the app)

Steps to reproduce:

  1. Install qTox nightly on a windows machine
  2. Change some things in settings
  3. Select "shut down" from windows…

Observed Behavior:
Settings were not saved.

Expected Behavior:
Settings should have persisted.

  • When I closed qTox by right-clicking the icon in the system tray and selecting "Quit", it DID save the settings.
C-bug P-low

Most helpful comment

I'm working on this.

All 9 comments

I've experienced this too on Debian testing. Quitting qTox in any way other than via the rclick menu throws out all changed settings.

So it should probably catch some destroy message(s) and forward the app to the same processing as ->right-click tray icon -> Quit does.

Or just save (via button?) before closing app

(sorry about double messaging)

qTox 1.3.0 is not saving the Audio and Video setting either.

I'm working on this.

Have some problem on Debian stable (qtox from repository pkg.tox.chat/debian/) - can't save video settings. In GUI I see "Resolution": 480 p, but
fgrep VideoRes .config/tox/qtox.ini
camVideoRes=@Size(1600 1200)
It is strange - https://en.wikipedia.org/wiki/480p
But main problem - if I change settings in GUI or config qTox does not use it and rewrite after restart.
I want change video resolution because on default setting video call very slow.

Since version v1.12.0 qTox has handled Posix signals, so this issue (should) be resolved there. It's still present on Windows when i.e. the system shuts down without qTox cleanly exiting.

Regarding clean exit on Windows... Handling WM_QUERYENDSESSION and WM_ENDSESSION messages should be sufficient, right? The first is sent around by Windows as a warning (and to get confirmation) and the latter is sent after all windows have been warned (and confirmed), which actually informs each window to terminate (right then & there, or not at all).

The handler for these messages could be implemented by testing the return values and invoking the regular application (save &) termination procedure, either by passing a message [ie. WM_CLOSE] to the window procedure, or just calling the same routine that the WM_CLOSE handler would have called.

Looking into this a bit, we do catch window's shutting down by connection to Qt's aboutToQuit, which triggers us to do some cleanup and save setttings. It looks like what's happening is that https://doc.qt.io/qt-5/qapplication.html#exec "on the Windows platform, when the user logs off, the system terminates the process after Qt closes all top-level windows.". Even though our cleanup is done as part of aboutToQuit as recommended, the first step in our cleanup is to delete our GUI, which deletes the top level window, at which point qTox is stopped before it saves settings.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iphydf picture iphydf  Â·  3Comments

azymohliad picture azymohliad  Â·  5Comments

akhilman picture akhilman  Â·  7Comments

ghost picture ghost  Â·  3Comments

Tcll picture Tcll  Â·  3Comments