Ensure Scene doesn't render non lock screen windows while screen is locked

The last stage for window rendering is triggered by
Scene::finalDrawWindow. Adding a security check there if screen is locked
no non-lock screen window should be rendered.

Unfortunately this method is virtual so the check needs to be done in the
base and all implementing child methods (currently only OpenGL).

REVIEW: 126144
master
Martin Gräßlin 9 years ago
parent 3e007b5198
commit 38cde38edf

@ -77,6 +77,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "overlaywindow.h"
#include "screens.h"
#include "shadow.h"
#include "wayland_server.h"
#include "thumbnailitem.h"
@ -608,6 +609,9 @@ void Scene::finalPaintWindow(EffectWindowImpl* w, int mask, QRegion region, Wind
// will be eventually called from drawWindow()
void Scene::finalDrawWindow(EffectWindowImpl* w, int mask, QRegion region, WindowPaintData& data)
{
if (waylandServer() && waylandServer()->isScreenLocked() && !w->window()->isLockScreen()) {
return;
}
w->sceneWindow()->performPaint(mask, region, data);
}

@ -1142,6 +1142,9 @@ Scene::Window *SceneOpenGL2::createWindow(Toplevel *t)
void SceneOpenGL2::finalDrawWindow(EffectWindowImpl* w, int mask, QRegion region, WindowPaintData& data)
{
if (waylandServer() && waylandServer()->isScreenLocked() && !w->window()->isLockScreen()) {
return;
}
if (!m_colorCorrection.isNull() && m_colorCorrection->isEnabled()) {
// Split the painting for separate screens
const int numScreens = screens()->count();

Loading…
Cancel
Save