summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/cube.c
diff options
context:
space:
mode:
authorquinn <quinn@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-27 19:56:51 +0000
committerquinn <quinn@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-27 19:56:51 +0000
commit46c60b7a5dcdef3c6b4947fe06de1626104da7fc (patch)
treeecbe6abed4c7d14fa738d655d7f4b16801cf235c /beryl-plugins/src/cube.c
parentf5d6a687e9993d552109744a91c33686072ebfb6 (diff)
downloadmarex-dev-46c60b7a5dcdef3c6b4947fe06de1626104da7fc.tar.gz
marex-dev-46c60b7a5dcdef3c6b4947fe06de1626104da7fc.tar.bz2
cube plugin:
* add option to stick sticky/dock windows to the screen instead of cube git-svn-id: file:///beryl/trunk@3256 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/cube.c')
-rw-r--r--beryl-plugins/src/cube.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/beryl-plugins/src/cube.c b/beryl-plugins/src/cube.c
index 89ae7d4..4b0fe8a 100644
--- a/beryl-plugins/src/cube.c
+++ b/beryl-plugins/src/cube.c
@@ -187,7 +187,8 @@ 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_NUM 27
+#define CUBE_SCREEN_OPTION_STUCK_TO_SCREEN 27
+#define CUBE_SCREEN_OPTION_NUM 28
typedef struct _CubeCapInfo
{
@@ -272,6 +273,7 @@ typedef struct _CubeScreen
int zoomLevelAtom;
+ Bool finalPaint;
} CubeScreen;
#define GET_CUBE_DISPLAY(d) \
@@ -1055,6 +1057,7 @@ 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:
@@ -1372,6 +1375,17 @@ 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";
@@ -1590,8 +1604,11 @@ cubePaintScreen(CompScreen * s,
|| (cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b
&& cs->desktopOpacity != OPAQUE))
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;
}
@@ -1599,6 +1616,7 @@ cubePaintScreen(CompScreen * s,
(cs->opt[CUBE_SCREEN_OPTION_TRANSPARENT].value.b &&
cs->desktopOpacity != OPAQUE))
{
+ cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
if (cs->sky.name)
{
if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
@@ -1642,6 +1660,25 @@ 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;
}
@@ -1872,6 +1909,8 @@ cubePaintTransformedScreen(CompScreen * s,
CUBE_SCREEN(s);
+ cs->finalPaint=!(cs->opt[CUBE_SCREEN_OPTION_STUCK_TO_SCREEN].value.b);
+
hsize = s->hsize;
if (cs->mmMode != Multiple)
hsize *= cs->nOutput;
@@ -2474,6 +2513,14 @@ 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);