[maemo-developers] Qt application crashes after 2 minutes if started from app grid
From: Thomas Perl th.perl at gmail.comDate: Tue May 10 21:37:51 EEST 2011
- Previous message: Qt application crashes after 2 minutes if started from app grid
- Next message: No subject
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, 2011/5/10 Cornelius Hald <hald at icandy.de>: > On Tue, 2011-05-10 at 18:24 +0300, Eero Tamminen wrote: >> On 05/09/2011 08:44 PM, ext Timur Kristóf wrote: >> > On 05/09/2011 04:43 PM, Kimmo Hämäläinen wrote: >> >> If you don't use D-Bus at all, you need to implement this >> >> single-instance and window raising yourself. >> > >> > This can be easily done with the QtSingleApplication class. >> >> If that works by starting a new instance of the application >> which them notices that it's already running and exits, >> that makes window topping a really heavy operation... > > Actually for me the single-instance thing works even with a normal > QApplication. I've removed the .service file and the service line in > the .desktop file. Still I can have only one instance. I think on Maemo 5, hildon-desktop is keeping track of which window belongs to which .desktop file (or: launcher icon) and if the application is already running, hildon-desktop simply switches to the application instead of instantiating a new one. That doesn't mean that it will work the same on any other environment (e.g. N900 MeeGo DE, etc..). It's a good idea though if most applications are single-instance, because it makes switching instantaneous, because hildon-desktop simply has to present the window without creating another process. The code is in src/launcher/hd-app-mgr.c in hildon-desktop's source - it should be in the function hd_app_mgr_launch() and hd_app_mgr_activate() if I'm not mistaken. The user could still start two instances if (s)he would start your application from X Terminal. If you want to prevent that, I'd suggest using D-Bus. HTH. Thomas
- Previous message: Qt application crashes after 2 minutes if started from app grid
- Next message: No subject
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]