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
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.
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> :customEvent( type=SURFACE_ WEVENT_ TYPE) :handleSurfaceF ocusChange( focused= false)
eventCallback (context=0x57c0e0, event=0xb2f6c090)
UbuntuInput:
UbuntuWindow:
<step 3 - power off>
<step 4 - power on>
<step 5 - unlock greeter>
virtual QSGVideoNode* ShaderVideoNode Plugin: :createNode( const QVideoSurfaceFo rmat&) rControl: :onTextureCreat ed(unsigned int) : textureId: 12
void AalVideoRendere
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 { .active) ? "green" : "red"
color: (Qt.application
}
so it is green if active, red if not. Run with file_hint= /usr/share/ applications/ mediaplayer- app.desktop
qmlscene active-app.qml --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.