Comment 1 for bug 1353593

Revision history for this message
Gerry Boland (gerboland) wrote :

I compiled qtubuntu with debug output enabled and watched the output while reproducing this bug.

I can confirm that unity8 is not sending camera app a focused event at step 5. So it appears that when the camera app process is resumed, it brings up the camera even if its window is not focused.

Relevant output (interspersed with comments):

<step 2 - enter spread>
eventCallback (context=0x57c0e0, event=0xb2f6c090)
UbuntuInput::customEvent(type=SURFACE_WEVENT_TYPE)
UbuntuWindow::handleSurfaceFocusChange(focused=false)

<step 3 - power off>
<step 4 - power on>
<step 5 - unlock greeter>

virtual QSGVideoNode* ShaderVideoNodePlugin::createNode(const QVideoSurfaceFormat&)
void AalVideoRendererControl::onTextureCreated(unsigned int) : textureId: 12
Already have a texture id and video sink, not creating a new one

<meaning camera backend starts up again to show camera output on screen - but no focused event has been sent to it>

So I created a simple QML app to exhibit the Qt.application.active property

import QtQuick 2.0

Rectangle {
    color: (Qt.application.active) ? "green" : "red"
}

so it is green if active, red if not. Run with
qmlscene active-app.qml --desktop_file_hint=/usr/share/applications/mediaplayer-app.desktop

This test exhibits the same problem as camera app does. Somehow Qt.application.active it set to be true after process resume, even if the surface is still unfocused.