diff --git a/metadata/rotate.xml.in b/metadata/rotate.xml.in index afba392..c0f1dc5 100644 --- a/metadata/rotate.xml.in +++ b/metadata/rotate.xml.in @@ -188,6 +188,11 @@ <_long>Invert Y axis for pointer movement false + + <_short>Pointer Restrict Y + <_long>Restrict Y axis for pointer movement + false + <_short>Pointer Sensitivity <_long>Sensitivity of pointer movement diff --git a/plugins/rotate.c b/plugins/rotate.c index 18f8015..c18e86f 100644 --- a/plugins/rotate.c +++ b/plugins/rotate.c @@ -90,13 +90,14 @@ typedef struct _RotateDisplay { } RotateDisplay; #define ROTATE_SCREEN_OPTION_POINTER_INVERT_Y 0 -#define ROTATE_SCREEN_OPTION_POINTER_SENSITIVITY 1 -#define ROTATE_SCREEN_OPTION_ACCELERATION 2 -#define ROTATE_SCREEN_OPTION_SNAP_TOP 3 -#define ROTATE_SCREEN_OPTION_SPEED 4 -#define ROTATE_SCREEN_OPTION_TIMESTEP 5 -#define ROTATE_SCREEN_OPTION_ZOOM 6 -#define ROTATE_SCREEN_OPTION_NUM 7 +#define ROTATE_SCREEN_OPTION_POINTER_RESTRICT_Y 1 +#define ROTATE_SCREEN_OPTION_POINTER_SENSITIVITY 2 +#define ROTATE_SCREEN_OPTION_ACCELERATION 3 +#define ROTATE_SCREEN_OPTION_SNAP_TOP 4 +#define ROTATE_SCREEN_OPTION_SPEED 5 +#define ROTATE_SCREEN_OPTION_TIMESTEP 6 +#define ROTATE_SCREEN_OPTION_ZOOM 7 +#define ROTATE_SCREEN_OPTION_NUM 8 typedef struct _RotateScreen { PreparePaintScreenProc preparePaintScreen; @@ -1468,6 +1469,9 @@ rotateHandleEvent (CompDisplay *d, if (rs->opt[ROTATE_SCREEN_OPTION_POINTER_INVERT_Y].value.b) pointerDy = -pointerDy; + if (rs->opt[ROTATE_SCREEN_OPTION_POINTER_RESTRICT_Y].value.b) + pointerDy = 0; + rs->xVelocity += pointerDx * rs->pointerSensitivity * cs->invert; rs->yVelocity += pointerDy * rs->pointerSensitivity; @@ -1769,6 +1773,7 @@ rotateFiniDisplay (CompPlugin *p, static const CompMetadataOptionInfo rotateScreenOptionInfo[] = { { "invert_y", "bool", 0, 0, 0 }, + { "restrict_y", "bool", 0, 0, 0 }, { "sensitivity", "float", 0, 0, 0 }, { "acceleration", "float", "1.0", 0, 0 }, { "snap_top", "bool", 0, 0, 0 },