summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xlocker.cpp38
-rw-r--r--src/xlocker.h1
2 files changed, 34 insertions, 5 deletions
diff --git a/src/xlocker.cpp b/src/xlocker.cpp
index 620e81d..95bfd90 100644
--- a/src/xlocker.cpp
+++ b/src/xlocker.cpp
@@ -52,7 +52,7 @@ X11LockWindow::X11LockWindow (Window child) :
if (XGetWindowProperty (screen->dpy (), child, LockerAtoms::lockerStatus, 0L,
4096L, false, XA_CARDINAL, &retType,
&retFmt, &retItems, &retLeft, &propData) == Success &&
- retItems == 6 &&
+ retItems == 7 &&
retLeft == 0 &&
retFmt == 32)
{
@@ -68,7 +68,9 @@ X11LockWindow::X11LockWindow (Window child) :
XAddToSaveSet (screen->dpy (), child);
XReparentWindow (screen->dpy (), child, mBackingWindow, 0, 0);
- mGeometry = CompRect (data[2], data[3], data[4], data[5]);
+ mGeometry = CompRect (screen->outputDevs ().front ().centerX () - data[4] / 2,
+ screen->outputDevs ().front ().centerY () - data[5] / 2,
+ data[4], data[5]);
}
}
@@ -80,14 +82,40 @@ X11LockWindow::~X11LockWindow ()
void
X11LockWindow::hide ()
{
+ long data[7];
XUnmapWindow (screen->dpy (), mBackingWindow);
+
+ data[0] = 1;
+ data[1] = mChild;
+ data[2] = x ();
+ data[3] = y ();
+ data[4] = width ();
+ data[5] = height ();
+ data[6] = 0;
+
+ XChangeProperty (screen->dpy (), mChild, LockerAtoms::lockerStatus,
+ XA_CARDINAL, 32, PropModeReplace, (const unsigned char *) data, 7);
+
mMapped = false;
}
void
X11LockWindow::show ()
{
+ long data[7];
XMapRaised (screen->dpy (), mBackingWindow);
+ /* Also set the visible bit */
+
+ data[0] = 1;
+ data[1] = mChild;
+ data[2] = x ();
+ data[3] = y ();
+ data[4] = width ();
+ data[5] = height ();
+ data[6] = 1;
+
+ XChangeProperty (screen->dpy (), mChild, LockerAtoms::lockerStatus,
+ XA_CARDINAL, 32, PropModeReplace, (const unsigned char *) data, 7);
mMapped = true;
}
@@ -233,11 +261,11 @@ X11LockerScreen::handleEvent (XEvent *event)
LockerAtoms::lockerStatus, 0L,
4096L, false, XA_CARDINAL, &retType,
&retFmt, &retItems, &retLeft, &propData) == Success &&
- retItems == 6 &&
+ retItems == 7 &&
retLeft == 0 &&
retFmt == 32)
{
- xlw->setGeometry (data[2], data[3], data[4], data[5]);
+ //xlw->setGeometry (data[2], data[3], data[4], data[5]);
}
}
}
@@ -331,7 +359,7 @@ X11LockerWindow::X11LockerWindow (CompWindow *w) :
if (status == Success)
{
- if (retItems == 6 && retFmt == 32 && retLeft == 0)
+ if (retItems == 7 && retFmt == 32 && retLeft == 0)
{
xlw = new X11LockWindow (window->id ());
LockerLockWindow::SetDefault (xlw);
diff --git a/src/xlocker.h b/src/xlocker.h
index c810e1c..f99cbb0 100644
--- a/src/xlocker.h
+++ b/src/xlocker.h
@@ -33,6 +33,7 @@
* data[3] = Y position of the locker window
* data[4] = Width of the locker window
* data[5] = Height of the locker window
+ * data[6] = Visibility of the locker window
*/
#define X_LOCKER_PROPERTY_NAME "_COMPIZ_NET_LOCKER_STATUS"