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

REVIEW:108643
REVIEW:108643
BUG:108643
parent f3279cf3
......@@ -33,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Qt
#include <QtCore/QTimer>
#include <QtCore/QPointer>
#include <QtGui/QDesktopWidget>
#include <QtGui/QPainter>
#include <QtGui/QX11Info>
// X11
......@@ -79,19 +80,19 @@ void LockWindow::initialize()
{
kapp->installX11EventFilter(this);
// 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
#ifdef CHECK_XSELECTINPUT
check_xselectinput = true;
#endif
XSelectInput( QX11Info::display(), QX11Info::appRootWindow(),
SubstructureNotifyMask | rootAttr.your_event_mask );
// Get root window size
updateGeometry();
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()
}
m_autoLogoutTimer->setSingleShot(true);
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();
setGeometry(desktop->geometry());
}
void LockWindow::paintEvent(QPaintEvent* )
{
QPainter p(this);
......
......@@ -49,6 +49,7 @@ protected:
private Q_SLOTS:
void autoLogoutTimeout();
void updateGeometry();
private:
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