From 6fd236b9e6fd8e78ba9e41d4442e590ac5591113 Mon Sep 17 00:00:00 2001 From: Roi Cohen Date: Tue, 12 Jun 2007 14:25:06 +0200 Subject: [PATCH] Added option to enable cube transparency only on button binding initiated rotatation. --- include/cube.h | 3 ++- metadata/cube.xml.in | 5 +++++ plugins/cube.c | 11 +++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/cube.h b/include/cube.h index 24ad28d..a8baf1f 100644 --- a/include/cube.h +++ b/include/cube.h @@ -58,7 +58,8 @@ typedef struct _CubeDisplay { #define CUBE_SCREEN_OPTION_ACTIVE_OPACITY 15 #define CUBE_SCREEN_OPTION_INACTIVE_OPACITY 16 #define CUBE_SCREEN_OPTION_FADE_TIME 17 -#define CUBE_SCREEN_OPTION_NUM 18 +#define CUBE_SCREEN_OPTION_TRANSPARENT_MANUAL_ONLY 18 +#define CUBE_SCREEN_OPTION_NUM 19 typedef void (*CubeGetRotationProc) (CompScreen *s, float *x, diff --git a/metadata/cube.xml.in b/metadata/cube.xml.in index 23d93e0..7405531 100644 --- a/metadata/cube.xml.in +++ b/metadata/cube.xml.in @@ -158,6 +158,11 @@ 10.0 0.1 + diff --git a/plugins/cube.c b/plugins/cube.c index 24e587c..843534a 100644 --- a/plugins/cube.c +++ b/plugins/cube.c @@ -839,10 +839,16 @@ cubePreparePaintScreen (CompScreen *s, memset (cs->cleared, 0, sizeof (Bool) * s->nOutputDev); /* Transparency handling */ - if (cs->rotationState != RotationNone) + if (cs->rotationState == RotationManual || + (cs->rotationState == RotationChange && + cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT_MANUAL_ONLY].value.b)) + { opt = CUBE_SCREEN_OPTION_ACTIVE_OPACITY; + } else + { opt = CUBE_SCREEN_OPTION_INACTIVE_OPACITY; + } cs->toOpacity = (cs->opt[opt].value.f / 100.0f) * OPAQUE; @@ -1927,7 +1933,8 @@ static const CompMetadataOptionInfo cubeScreenOptionInfo[] = { { "adjust_image", "bool", 0, 0, 0 }, { "active_opacity", "float", "0.0100.0", 0, 0 }, { "inactive_opacity", "float", "0.0100.0", 0, 0 }, - { "fade_time", "float", "0.0", 0, 0 } + { "fade_time", "float", "0.0", 0, 0 }, + { "transparent_manual_only", "bool", 0, 0, 0 } }; static Bool -- 1.5.0.6