summaryrefslogtreecommitdiff
path: root/src/locker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/locker.cpp')
-rw-r--r--src/locker.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/locker.cpp b/src/locker.cpp
index 5dfcf56..180c417 100644
--- a/src/locker.cpp
+++ b/src/locker.cpp
@@ -115,35 +115,47 @@ SimpleLockerWindow::paint (const GLMatrix &transform)
bool
SimpleLockerWindow::handleKeyPress (XKeyEvent *xk)
{
- Lockable::Default ()->unlock ();
return true;
}
bool
SimpleLockerWindow::handleKeyRelease (XKeyEvent *xk)
{
- Lockable::Default ()->unlock ();
return true;
}
bool
SimpleLockerWindow::handleButtonPress (XButtonEvent *xb)
{
- Lockable::Default ()->unlock ();
+ CompPoint p;
+ CompRegion r;
+
+ r = CompRect (x () + width () / 2.0f - 150, y () + height () / 2.0f - 150, 300, 300);
+ p = CompPoint (xb->x_root, xb->y_root);
+
+ if (r.contains (p))
+ Lockable::Default ()->unlock ();
+
return true;
}
bool
SimpleLockerWindow::handleButtonRelease (XButtonEvent *xb)
{
- Lockable::Default ()->unlock ();
+ CompPoint p;
+ CompRegion r;
+
+ r = CompRect (x () + width () / 2.0f - 150, y () + height () / 2.0f - 150, 300, 300);
+ p = CompPoint (xb->x_root, xb->y_root);
+
+ if (r.contains (p))
+ Lockable::Default ()->unlock ();
return true;
}
bool
SimpleLockerWindow::handleMotion (XMotionEvent *xm)
{
- Lockable::Default ()->unlock ();
return true;
}