Patch: Crash: blocking JS alert and deleting a window
David Faure
david at mandrakesoft.com
Mon Oct 28 22:29:26 GMT 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 28 October 2002 16:05, Koos Vriezen wrote:
> > Looking at the last patch, the one with EventFilterer.....
> > The goal is to get the CloseEvent of the mainwindow, but due
> > to the reparenting, you can't get hold of the mainwindow when
> > the htmlview is created, right? (hence all that code with the
> > Reparent event etc.)
>
> Yes that's what I thought after grep'ing for 'reparent' in
> kdebase/konqueror, but later I couldn't find the kdDebug output. I think
> it simply can be removed, but it is to make sure we're monitoring to
> toplevelWidget.
Ah so it was only a wrong guess?
Yes, on 2nd though the parent widget is always set correctly when creating
the part, and we only use reparenting when splitting/unsplitting views - the
toplevel widget remains the same.
> > This is why I was thinking of something slightly different:
> > a new kind of event, which we'd define ourselves (like those defined
> > in kparts/event.h). This event would be sent to konqueror's
> > parts before destroying them.
> > Hmm, I guess we could also simply send a CloseEvent, if Qt
> > doesn't do it for non-toplevel-widgets?
> > The point is that we could then simply write KHTMLView::closeEvent()
> > instead of having to create an event filterer.
>
> Maybe, but is konqueror active closing the mainwindow or just responding
> to a X/WM close event.
? Not sure what you mean here.
> If so, the EventFilterer should be moved to
> konqueror to get something like KHTMLView::closeEvent() working, which
> doesn't reduce complexity than.
? KonqMainWindow has a closeEvent() already. No need for an event filter,
the toplevel widget gets a close event, it can simply implement closeEvent().
> Not to mention other hosts for KHTML...
We should put the code in KParts::MainWindow::closeEvent, indeed.
> Btw. if this is the only solution we can think of, we are still not done.
> What about scripts like: 'alert(foo);alert(bar)' or
> 'eval("alert(foo)");alert(bar)'? KJS::Window should also be informed
> not to spawn another message box.
(saw your next msg). Hmm, strange indeed. Will check tomorrow (I'll also try
to come up with a patch for my CloseEvent idea).
- --
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9vbpH72KcVAmwbhARAo1qAJ9YzbpPFTCdrXLwbs4onZLQrYSaLQCfZeE5
TOp2uHc3BJLXDakBvZPoEvI=
=sRYy
-----END PGP SIGNATURE-----
More information about the kfm-devel
mailing list