[Webkit-unassigned] [Bug 33842] [Qt] media tests crash

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 21 05:29:40 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33842





--- Comment #7 from Jakub Wieczorek <faw217 at gmail.com>  2010-01-21 05:29:39 PST ---
(In reply to comment #6)
> From http://qt.nokia.com/doc/4.6/qapplication.html#lastWindowClosed:
> 
> "This signal is emitted from QApplication::exec() when the last visible primary
> window (i.e. window with no parent) with the Qt::WA_QuitOnClose attribute set
> is closed."
> 
> The video widget has the Qt::WA_DontShowOnScreen flag set. Pre Qt 4.5 this flag
> was not considered when deciding "is this window visible" (it has no parent, so
> it's a primary window), so the video widget would keep the QtLauncher running
> even after the main window was closed. 
> 
> The fix was to also set Qt::WA_QuitOnClose, so that closing the main
> application would be considered the "last visible primary window with the
> Qt::WA_QuitOnClose attribute set".
> 
> What's happening here seems to be that we receive the lastWindowClosed signal
> since we're running the DRT headless, and the video widget is not considered
> visible due to the flag, so we end up quitting the DRT since the signal is
> implicitly connected to QApplication::quit().
> 
> I think the solution might be to set quitOnLastWindowClosed to false, could you
> try that without removing the ifdef and see if it works?  
> 
> http://qt.nokia.com/doc/4.6/qapplication.html#quitOnLastWindowClosed-prop

I tried that before but it looks more like a work around to me. It would solve
the problem for DRT - OK, but it seems that this sort of behavior would be
present in any application that runs headless? Consider the following example:

class WebView : public QWebView
{
    Q_OBJECT

    public:
        WebView() { }

    public slots:
        void loadMedia()
        {
            load(QUrl("site-with-audio-or-video"));
        }

        void loadGoogle()
        {
            load(QUrl("http://google.com"));
        }
};

QApplication app(argc, argv);

WebView view;
QTimer::singleShot(1000, &view, SLOT(loadMedia()));
QObject::connect(&view, SIGNAL(loadFinished(bool)), &view, SLOT(loadGoogle()));

return app.exec();

This example quits right after it starts loading google.com.

It is discussable whether applications that do not show any widgets on the
screen should set quitOnLastWindowClosed to false. The problem we're talking
about is kinda expectable for normal Qt applications though.

But here, a developer would have no clue about what's going on because the
widget that triggers this sort of thing is hidden under the hood and therefore
the behavior is hard to diagnose. A developer shouldn't even care about the
underlying video widget. And as it is embedded withing a web page, it should be
safe to exclude it from deciding when the application quits.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list