Commit 677beae1 authored by Aaron J. Seigo's avatar Aaron J. Seigo
Browse files

update geometry of the lock window when screen changes

this is the window that lays *under* the acdtual lock UI, and which
prevents visibility of the underlying desktop (and lets the window
manager know what's up) thereby allowing us to care a lot less about
whether the greeter crashes while improving security with compositing on.

previously it was not changing geom when the screen would .. which was
not noticed due to a combination of issues; but with kscreen being used,
its magic revealed the problem.

based on a patch by Thomas Lübking

parent f3279cf3
......@@ -33,6 +33,7 @@ along with this program. If not, see <>.
// Qt
#include <QtCore/QTimer>
#include <QtCore/QPointer>
#include <QtGui/QDesktopWidget>
#include <QtGui/QPainter>
#include <QtGui/QX11Info>
// X11
......@@ -79,19 +80,19 @@ void LockWindow::initialize()
// Get root window size
XWindowAttributes rootAttr;
QX11Info info;
XGetWindowAttributes(QX11Info::display(), RootWindow(QX11Info::display(),
info.screen()), &rootAttr);
kapp->desktop(); // make Qt set its event mask on the root window first
XSelectInput( QX11Info::display(), QX11Info::appRootWindow(),
SubstructureNotifyMask | rootAttr.your_event_mask );
QApplication::desktop(); // make Qt set its event mask on the root window first
check_xselectinput = true;
XSelectInput( QX11Info::display(), QX11Info::appRootWindow(),
SubstructureNotifyMask | rootAttr.your_event_mask );
// Get root window size
setGeometry(0, 0, rootAttr.width, rootAttr.height);
// virtual root property
gXA_VROOT = XInternAtom (QX11Info::display(), "__SWM_VROOT", False);
gXA_SCREENSAVER_VERSION = XInternAtom (QX11Info::display(), "_SCREENSAVER_VERSION", False);
......@@ -116,6 +117,8 @@ void LockWindow::initialize()
connect(m_autoLogoutTimer, SIGNAL(timeout()), SLOT(autoLogoutTimeout()));
connect(QApplication::desktop(), SIGNAL(resized(int)), SLOT(updateGeometry()));
connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), SLOT(updateGeometry()));
void LockWindow::showLockWindow()
......@@ -279,6 +282,7 @@ void LockWindow::removeVRoot(Window win)
XDeleteProperty (QX11Info::display(), win, gXA_VROOT);
static void fakeFocusIn( WId window )
// We have keyboard grab, so this application will
......@@ -526,6 +530,12 @@ void LockWindow::autoLogoutTimeout()
void LockWindow::updateGeometry()
QDesktopWidget *desktop = QApplication::desktop();
void LockWindow::paintEvent(QPaintEvent* )
QPainter p(this);
......@@ -49,6 +49,7 @@ protected:
private Q_SLOTS:
void autoLogoutTimeout();
void updateGeometry();
void initialize();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment