[maemo-developers] QtMobility app shows, hides, shows again at startup

From: Thomas Perl th.perl at gmail.com
Date: Sat Apr 9 11:11:08 EEST 2011
Hi David,

2011/4/8 David Talmage <talmage at acm.org>:
> My newly released PanicButton application [1] behaves strangely at startup.
> When I start the application, it displays its window, then immediately hides
> the window.  In a few but significant number of seconds, it displays its window
> again.  It should display its window only once. Perhaps one of you can help me
> make it behave the right way. I can't be the only one who has ever encountered
> this application behavior.

Is the first window that you see a black one that animates from the
application icon to fill the screen and has the sound effect of an
opening window attached to it? If so, it's just a fake window
displayed by the window manager (hildon-desktop) that will stay there
for some seconds (the idea being that your application is fast enough
to open a window, which will then replace that fake window). The fake
window makes the user feel that the application startup is instant
(via the animation) while giving the application a second or two to
really start up and show a window.

You can "fix" this by doing all the time-consuming operations *after*
you have created and shown your window. You can usually populate your
window with contents even after it has been shown, so that would be a
good idea to do in that case. You can do this using single-shot
QTimer, so that the main loop gets enough time to really show and draw
the initial window.

HTH.
Thomas
More information about the maemo-developers mailing list