Bug 159095

Summary: Plots created using javaScript are not always added to window
Product: [Applications] kst Reporter: Andrew Walker <arwalker>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.4.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Andrew Walker 2008-03-10 21:58:16 UTC
Version:           1.4.0 (using KDE 3.5.9)
Installed from:    Compiled From Sources
OS:                Linux

In the following code snippet:

 name="X Corr";
 if (Kst.windows[name]) Kst.windows[name].close();
 myWindow = new Window(name);
 myWindow.name=name;
 crossPowerPlot=new Plot(Kst.windows[1]);

it is not always the case that the plot is added to the window. If the last line is changed to:

 crossPowerPlot=new Plot(myWindow);

everything seems to work fine. Using crossPowerPlot=new Plot(Kst.windows[name]) causes the same
problems.
Comment 1 Andrew Walker 2008-03-10 22:00:15 UTC
The KMdiChildView::close() method ends up POSTing a KMdiViewCloseEvent to the application. As a result of this the window will be closed at some later time.
What we really want to do is close the window immediately to avoid race conditions, so we should SEND the message instead.
Comment 2 Andrew Walker 2008-03-10 22:01:57 UTC
SVN commit 784195 by arwalker:

BUG:159095 From javaScript close a window immediately when requested, and not at some later time

 M  +12 -1     bind_window.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=784195