summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/cube.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-27 21:01:16 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-27 21:01:16 +0000
commit3d18fba168ef0d9dd41760b19be63aa2c1fb4614 (patch)
tree42b3a5b62c8cf793c5ebdfd437a4453564b97e28 /beryl-plugins/src/cube.c
parent0039513d015de76f1b9252f666d0b120e4a305cd (diff)
downloadmarex-dev-3d18fba168ef0d9dd41760b19be63aa2c1fb4614.tar.gz
marex-dev-3d18fba168ef0d9dd41760b19be63aa2c1fb4614.tar.bz2
If berylDesktopManaged draw as transparent even if desktopOpacity = OPAQUE so ARGB works
git-svn-id: file:///beryl/trunk@3264 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/cube.c')
-rw-r--r--beryl-plugins/src/cube.c83
1 files changed, 17 insertions, 66 deletions
diff --git a/beryl-plugins/src/cube.c b/beryl-plugins/src/cube.c
index 9e292cc..40740e8 100644
--- a/beryl-plugins/src/cube.c
+++ b/beryl-plugins/src/cube.c
@@ -187,8 +187,7 @@ typedef struct _CubeDisplay
#define CUBE_SCREEN_OPTION_CAP_TRANSPARENT 24
#define CUBE_TRANSPARENT_MANUALONLY 25
#define CUBE_SCREEN_OPTION_UNFOLD_ZOOM_DISTANCE 26
-#define CUBE_SCREEN_OPTION_STUCK_TO_SCREEN 27
-#define CUBE_SCREEN_OPTION_NUM 28
+#define CUBE_SCREEN_OPTION_NUM 27
typedef struct _CubeCapInfo
{
@@ -273,7 +272,6 @@ typedef struct _CubeScreen
int zoomLevelAtom;
- Bool finalPaint;
} CubeScreen;
#define GET_CUBE_DISPLAY(d) \
@@ -1057,7 +1055,6 @@ cubeSetScreenOption(CompScreen * screen, char *name, CompOptionValue * value)
}
break;
case CUBE_SCREEN_OPTION_TRANSPARENT:
- case CUBE_SCREEN_OPTION_STUCK_TO_SCREEN:
case CUBE_SCREEN_OPTION_CAP_TRANSPARENT:
case CUBE_SCREEN_OPTION_VIEWPORT_SLIDE:
case CUBE_TRANSPARENT_MANUALONLY:
@@ -1375,17 +1372,6 @@ static void cubeScreenInitOptions(CubeScreen * cs)
o->type = CompOptionTypeBool;
o->value.b = CUBE_TRANSPARENT_DEFAULT;
- o = &cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN];
- o->advanced = False;
- o->name = "stuck_to_screen";
- o->group = N_("Options");
- o->subGroup = N_("");
- o->displayHints = "";
- o->shortDesc = N_("Stick Sticky Windows to Screen");
- o->longDesc = N_("Cause dock and sticky windows to be drawn stuck to the screen instead of the cube");
- o->type = CompOptionTypeBool;
- o->value.b = FALSE;
-
o = &cs->opt[CUBE_SCREEN_OPTION_CAP_TRANSPARENT];
o->advanced = False;
o->name = "cap_transparent_snap";
@@ -1602,21 +1588,17 @@ cubePaintScreen(CompScreen * s,
if (cs->grabIndex
|| (cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b
- && (cs->desktopOpacity != OPAQUE || s->berylDesktopManaged)))
+ && ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged)))
mask &= ~PAINT_SCREEN_REGION_MASK;
- cs->finalPaint=TRUE;
-
if (cs->grabIndex)
{
- cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
mask |= PAINT_SCREEN_TRANSFORMED_MASK;
}
if ((!mask & PAINT_SCREEN_TRANSFORMED_MASK) &&
(cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b &&
- (cs->desktopOpacity != OPAQUE || s->berylDesktopManaged)))
+ ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged)))
{
- cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
if (cs->sky.name)
{
if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
@@ -1660,25 +1642,6 @@ cubePaintScreen(CompScreen * s,
status = (*s->paintScreen) (s, sAttrib, region, output, mask);
WRAP(cs, s, paintScreen, cubePaintScreen);
- if (!cs->finalPaint)
- {
- glPushMatrix();
-
- prepareXCoords(s, output, -DEFAULT_Z_CAMERA);
- cs->finalPaint=TRUE;
- CompWindow * w;
- for (w=s->reverseWindows;w;w=w->prev)
- {
- if (((w->type & CompWindowTypeDockMask) || (w->state & CompWindowStateStickyMask) ||
- w->attrib.override_redirect) &&
- (w->mapNum && w->attrib.map_state == IsViewable && !(w->minimized) && !(w->state & CompWindowStateHiddenMask)))
- {
- s->paintWindow(w,&w->paint,getInfiniteRegion(),0);
- }
- }
- glPopMatrix();
- }
-
return status;
}
@@ -1686,8 +1649,10 @@ static void cubeDonePaintScreen(CompScreen * s)
{
CUBE_SCREEN(s);
- if (cs->grabIndex || cs->toOpacity != cs->desktopOpacity)
+ if (cs->grabIndex || cs->toOpacity != cs->desktopOpacity || s->berylDesktopManaged)
+ {
damageScreen(s);
+ }
UNWRAP(cs, s, donePaintScreen);
(*s->donePaintScreen) (s);
@@ -1844,7 +1809,7 @@ cubeMoveViewportAndPaint(CompScreen * s,
if (dView != 0)
cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
if (dView != 0 && !screenGrabExist(s, "rotate", 0) &&
- cs->desktopOpacity != OPAQUE)
+ ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged))
cs->noManaged = TRUE;
moveScreenViewport(s, -dView, 0, FALSE);
(*s->paintTransformedScreen) (s, sAttrib,
@@ -1857,7 +1822,7 @@ cubeMoveViewportAndPaint(CompScreen * s,
if (dx != 0)
cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
if (dx != 0 && !screenGrabExist(s, "rotate", 0) &&
- cs->desktopOpacity != OPAQUE)
+ ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged))
cs->noManaged = TRUE;
moveScreenViewport(s, dx, 0, FALSE);
(*s->paintTransformedScreen) (s, sAttrib, &s->region, output, mask);
@@ -2000,12 +1965,6 @@ cubePaintTransformedScreen(CompScreen * s,
sa.xTranslate = sAttrib->xTranslate;
sa.yTranslate = sAttrib->yTranslate;
-
- if (screenGrabExist(s, "rotate", "cube", 0))
- cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
- else
- cs->finalPaint=TRUE;
-
if (cs->grabIndex)
{
sa.vRotate = 0.0f;
@@ -2105,8 +2064,8 @@ cubePaintTransformedScreen(CompScreen * s,
if (cs->grabIndex || hsize > 4 ||
(cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b &&
- cs->desktopOpacity != OPAQUE) ||
- compDisplayGetRequestFlagForAny(s->display, "DRAW_ALL_FACES"))
+ ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged)) ||
+ compDisplayGetRequestFlagForAny(s->display, "DRAW_ALL_FACES")))
{
int i;
@@ -2202,14 +2161,14 @@ cubePaintTransformedScreen(CompScreen * s,
int num = 0, j;
if (cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b &&
- cs->desktopOpacity != OPAQUE)
+ ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged))
mask |= PAINT_SCREEN_TRANSFORMED_MASK;
if ((cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b ||
compDisplayGetRequestFlagForAny(s->display, "DRAW_ALL_FACES"))
&& cs->invert == 1)
{
- if (glIsEnabled(GL_CULL_FACE) && cs->desktopOpacity != OPAQUE)
+ if (glIsEnabled(GL_CULL_FACE) && ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged))
{
disabledCull = TRUE;
glDisable(GL_CULL_FACE);
@@ -2260,7 +2219,7 @@ cubePaintTransformedScreen(CompScreen * s,
if (cs->grabIndex == 0 && (hsize > 2) &&
(cs->invert != 1 || sa.vRotate != 0.0f || sa.yTranslate != 0.0f
|| (cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b
- && cs->desktopOpacity != OPAQUE))
+ && ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) || s->berylDesktopManaged)))
&& cs->opt[CUBE_SCREEN_OPTION_DRAW_CAPS].value.b
&& !compDisplayGetRequestFlagForAny(s->display, "NO_CUBE_CAPS"))
{
@@ -2318,13 +2277,13 @@ cubePaintTransformedScreen(CompScreen * s,
}
if (glIsEnabled(GL_CULL_FACE)
- && cs->desktopOpacity != OPAQUE && cs->invert == 1)
+ && (cs->desktopOpacity != OPAQUE || s->berylDesktopManaged) && cs->invert == 1)
{
disabledCull = TRUE;
glDisable(GL_CULL_FACE);
}
- if (cs->desktopOpacity != OPAQUE)
+ if ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged))
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -2467,7 +2426,7 @@ cubePaintBackground(CompScreen * s, Region region, unsigned int mask)
&& !(mask & PAINT_BACKGROUND_WITH_STENCIL_MASK))
return;
- if (cs->desktopOpacity != OPAQUE)
+ if ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged))
{
if (s->desktopWindowCount)
{
@@ -2487,7 +2446,7 @@ cubePaintBackground(CompScreen * s, Region region, unsigned int mask)
(*s->paintBackground) (s, region, mask);
WRAP(cs, s, paintBackground, cubePaintBackground);
- if (cs->desktopOpacity != OPAQUE)
+ if ((cs->desktopOpacity != OPAQUE || s->berylDesktopManaged))
{
if (s->desktopWindowCount)
{
@@ -2525,14 +2484,6 @@ cubePaintWindow(CompWindow * w,
if (!w->managed && cs->noManaged)
return TRUE;
- if ((w->type & CompWindowTypeDockMask) || (w->state & CompWindowStateStickyMask))
- {
- if (!cs->finalPaint)
- {
- return TRUE;
- }
- }
-
UNWRAP(cs, w->screen, paintWindow);
status = (*w->screen->paintWindow) (w, &wa, region, mask);
WRAP(cs, w->screen, paintWindow, cubePaintWindow);