summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/rotate.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-20 08:19:38 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-20 08:19:38 +0000
commit2a204eba2e097768b5fe91f33163e2f91302a92a (patch)
tree24d91cad937d6643c608413b1d7b3b62e502eb76 /beryl-plugins/src/rotate.c
parent983952e816310b9ecf69223a013b44eab3890d10 (diff)
downloadmarex-dev-2a204eba2e097768b5fe91f33163e2f91302a92a.tar.gz
marex-dev-2a204eba2e097768b5fe91f33163e2f91302a92a.tar.bz2
beryl-plugins: make descale and viewport change one fluid motion (patch by Vuen [thanks!], closes #1055)
git-svn-id: file:///beryl/trunk@1301 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/rotate.c')
-rw-r--r--beryl-plugins/src/rotate.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/beryl-plugins/src/rotate.c b/beryl-plugins/src/rotate.c
index 1ecfe7c..00b6f17 100644
--- a/beryl-plugins/src/rotate.c
+++ b/beryl-plugins/src/rotate.c
@@ -711,7 +711,8 @@ rotatePreparePaintScreen (CompScreen * s, int msSinceLastPaint)
rs->xVelocity = 0.0f;
rs->yVelocity = 0.0f;
- if (fabs (rs->yrot) < 0.1f)
+ //if de-scaling, don't end the rotation until scale is finished
+ if (fabs (rs->yrot) < 0.1f && !otherScreenGrabExist (s, "rotate", "move", "switcher", "cube", 0))
{
float xrot;
int tx;
@@ -1145,7 +1146,8 @@ rotate (CompDisplay * d,
if (s->hsize < 2)
return FALSE;
- if (otherScreenGrabExist (s, "rotate", "move", "switcher", "cube", 0))
+ //allow rotation to proceed if we're de-scaling
+ if (otherScreenGrabExist (s, "rotate", "move", "switcher", "cube", "scale", 0))
return FALSE;
direction = getIntOptionNamed (option, nOption, "direction", 0);
@@ -2182,11 +2184,22 @@ rotateHandleEvent (CompDisplay * d, XEvent * event)
{
int dx;
- if (otherScreenGrabExist (s, "rotate", "switcher", "cube", 0))
+ //allow rotation to proceed if we're de-scaling
+ if (otherScreenGrabExist (s, "rotate", "switcher", "cube", "scale", 0))
break;
+ ROTATE_SCREEN (s);
dx = event->xclient.data.l[0] / s->width - s->x;
- if (dx)
+
+ //if already moving, modify motion in progress
+ if (rs->moving) {
+ if (dx > (s->hsize + 1) / 2)
+ dx -= s->hsize;
+ else if (dx < -(s->hsize + 1) / 2)
+ dx += s->hsize;
+ rs->moveTo = (360.0f / s->hsize) * dx;
+ }
+ else if (dx)
{
Window win;
int i, x, y;