[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Thu May 22 02:36:58 CEST 2008


Hi all,

Thanks for looking into it with me Akarsh.  I think I have diagnosed
the problem, but have not implemented a fix yet.

Basically, it's a chicken-and-egg issue in KStars::datainitFinished().
 If a KMessageBox is shown before the main window is shown, then the
program exits when the message box closes.  This seems weird to
me...as if KApplication considers the message box to be the program's
main window!  And it's not like the KStars object doesn't exist at
this point, it simply hasn't called "show()" yet.

The solution is to move initFocus() so that it comes after show() in
datainitFinished().  It's not so simple though.  Each of the functions
that gets called here has implications on the others, so the ordering
can have unexpected consequences.  This is what I mean by
chicken-and-egg, and by my earlier reference to the startup process
being fragile.  I'm hoping I'll have time to come up with a robust,
simple and easy to understand startup procedure soon.

regards,
Jason

PS- it's my birthday!  I'm 35 already but somehow I don't mind that so
much now that I'm a  father :)


On 5/19/08, Akarsh Simha <akarshsimha at gmail.com> wrote:
> Hi Jason,
>
>> By the way, I noticed that if the initial startup position is below
>> the horizon, the program quits after showing the main window for a
>> fraction of a second.  The quit happens whether you select "Reset
>> Position" or "Keep Position" in the warning dialog.
>>
>> gdb claims that there's no crash, it just "exits normally".  I have no
>> idea why it exits.  Anyone want to have a look?  I might not have time
>> to give it my attention until later next week...
>
> This bug seems very deep-rooted somewhere. A few observations that I
> made:
>
> 1. If we do not display the Message Box [comment the KMessageBox
> call], the application does not quit after startup, irrespective of
> whether we enter the if-block or not.
>
> 2. If we comment out guardedDialog->exec() in
> KMessageBox::createKMessageBox under
> kdelibs/kdeui/dialogs/kmessagebox.cpp, the dialog is not displayed,
> and the program doesn't terminate.
>
> 3. I couldn't figure out much with GDB, because I couldn't get past
> some GLib call that was compiled without symbols - so I couldn't step
> after that. Both situations [i.e. initial position below the horizon
> and above the horizon] go on smoothly until KStars::datainitFinished()
> returns.
>
> 4. Could it be some unclean Qt or KDELibs code?
>
> 5. Latest kdelibs hasn't helped, although there has been some fix to
> kmessagebox.cpp and kdialog.cpp. I'm yet to update Qt and try out.
>
> Regards
> Akarsh
>


More information about the Kstars-devel mailing list