summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/miniview.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-02 19:39:13 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-02 19:39:13 +0000
commit3e446757afc40ba56b00a0e6fba0520876926c33 (patch)
tree70d870dc716d03a43ba6036b797e1a54c86316b1 /beryl-plugins/src/miniview.c
parent39b78413d58b6808cd38bbea9033934d6657993b (diff)
downloadmarex-dev-3e446757afc40ba56b00a0e6fba0520876926c33.tar.gz
marex-dev-3e446757afc40ba56b00a0e6fba0520876926c33.tar.bz2
Actually calculate the width/height of the miniview in handleEvent rather than using an arbitrary value
git-svn-id: file:///beryl/trunk@3581 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/miniview.c')
-rw-r--r--beryl-plugins/src/miniview.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/beryl-plugins/src/miniview.c b/beryl-plugins/src/miniview.c
index 460e52e..b94f928 100644
--- a/beryl-plugins/src/miniview.c
+++ b/beryl-plugins/src/miniview.c
@@ -94,12 +94,19 @@ static void miniviewHandleEvent(CompDisplay * d, XEvent * event)
{
case ButtonPress:
s = findScreenAtDisplay(d, event->xbutton.root);
+
if (s)
{
MINIVIEW_SCREEN(s);
- if ( (d->pointerX > (ms->miniX - 50)) && (d->pointerX < (ms->miniX + 50)))
+ float xam = s->workArea.width;
+ xam /= -ms->zCam;
+ xam /= 2;
+ float yam = s->workArea.height;
+ yam /= -ms->zCam;
+ yam /=2;
+ if ( (d->pointerX > (ms->miniX - xam)) && (d->pointerX < (ms->miniX + xam)))
{
- if ( ( d->pointerY > (ms->miniY - 50)) && (d->pointerY < (ms->miniY + 50)))
+ if ( ( d->pointerY > (ms->miniY - yam)) && (d->pointerY < (ms->miniY + yam)))
{
ms->moving = !ms->moving;
damageScreen(s);