44
44
COMPIZ_PLUGIN_20090315 (cube, CubePluginVTable)
47
CubeScreenInterface::cubeGetRotation (float &x, float &v, float &progress)
47
CubeScreenInterface::cubeGetRotation (float &x,
48
50
WRAPABLE_DEF (cubeGetRotation, x, v, progress);
51
CubeScreenInterface::cubeClearTargetOutput (float xRotate, float vRotate)
53
CubeScreenInterface::cubeClearTargetOutput (float xRotate,
52
55
WRAPABLE_DEF (cubeClearTargetOutput, xRotate, vRotate);
55
58
CubeScreenInterface::cubePaintTop (const GLScreenPaintAttrib &sAttrib,
56
const GLMatrix &transform,
59
const GLMatrix &transform,
59
62
const GLVector &normal)
60
63
WRAPABLE_DEF (cubePaintTop, sAttrib, transform, output, size, normal)
63
66
CubeScreenInterface::cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
64
67
const GLMatrix &transform,
96
99
CompOutput *output,
98
101
WRAPABLE_DEF (cubeShouldPaintViewport, sAttrib, transform, output, order)
101
104
CubeScreenInterface::cubeShouldPaintAllViewports ()
102
105
WRAPABLE_DEF (cubeShouldPaintAllViewports);
231
PrivateCubeScreen::updateGeometry (int sides, int invert)
238
PrivateCubeScreen::updateGeometry (int sides,
233
GLfloat radius, distance;
237
244
sides *= mNOutput;
239
distance = 0.5f / tanf (M_PI / sides);
240
radius = 0.5f / sinf (M_PI / sides);
246
GLfloat distance = 0.5f / tanf (M_PI / sides);
247
GLfloat radius = 0.5f / sinf (M_PI / sides);
249
int n = (sides + 2) * 2;
244
251
if (mNVertices != n)
285
292
PrivateCubeScreen::updateOutputs ()
287
CompOutput *pBox0, *pBox1;
294
CompOutput *pBox0, *pBox1;
288
295
unsigned int i, j;
293
298
mFullscreenOutput = true;
295
for (i = 0; i < screen->outputDevs ().size (); i++)
300
for (i = 0; i < screen->outputDevs ().size (); ++i)
297
302
mOutputMask[i] = -1;
308
313
if (pBox0->y1 () != pBox1->y1 () || pBox0->y2 () != pBox1->y2 ())
313
for (j = 0; j < screen->outputDevs ().size (); j++)
318
for (j = 0; j < screen->outputDevs ().size (); ++j)
315
320
pBox0 = &screen->outputDevs ()[j];
317
322
/* must not intersect other output region */
318
323
if (i != j && pBox0->x2 () > pBox1->x1 () && pBox0->x1 () < pBox1->x2 ())
393
400
CompString imgName = optionGetSkydomeImage ();
394
CompString pname = "cube";
401
CompString pname = "cube";
396
403
if (optionGetSkydomeImage ().empty () ||
397
404
(mSky = GLTexture::readImageToTexture (imgName, pname, mSkySize)).empty ())
406
GLfloat MaxUShortFloat = static_cast <GLfloat>
407
(std::numeric_limits <unsigned short>::max ());
399
408
GLfloat aaafTextureData[128][128][3];
400
GLfloat fRStart = (GLfloat) optionGetSkydomeGradientStartColorRed () / 0xffff;
401
GLfloat fGStart = (GLfloat) optionGetSkydomeGradientStartColorGreen () / 0xffff;
402
GLfloat fBStart = (GLfloat) optionGetSkydomeGradientStartColorBlue () / 0xffff;
403
GLfloat fREnd = (GLfloat) optionGetSkydomeGradientEndColorRed () / 0xffff;
404
GLfloat fGEnd = (GLfloat) optionGetSkydomeGradientEndColorGreen () / 0xffff;
405
GLfloat fBEnd = (GLfloat) optionGetSkydomeGradientEndColorBlue () / 0xffff;
406
GLfloat fRStep = (fREnd - fRStart) / 128.0f;
407
GLfloat fGStep = (fGEnd - fGStart) / 128.0f;
408
GLfloat fBStep = (fBStart - fBEnd) / 128.0f;
409
GLfloat fR = fRStart;
410
GLfloat fG = fGStart;
411
GLfloat fB = fBStart;
415
for (iX = 127; iX >= 0; iX--)
410
GLfloat fRStart = optionGetSkydomeGradientStartColorRed () / MaxUShortFloat;
411
GLfloat fGStart = optionGetSkydomeGradientStartColorGreen () / MaxUShortFloat;
412
GLfloat fBStart = optionGetSkydomeGradientStartColorBlue () / MaxUShortFloat;
414
GLfloat fREnd = optionGetSkydomeGradientEndColorRed () / MaxUShortFloat;
415
GLfloat fGEnd = optionGetSkydomeGradientEndColorGreen () / MaxUShortFloat;
416
GLfloat fBEnd = optionGetSkydomeGradientEndColorBlue () / MaxUShortFloat;
418
GLfloat fRStep = (fREnd - fRStart) / 128.0f;
419
GLfloat fGStep = (fGEnd - fGStart) / 128.0f;
420
GLfloat fBStep = (fBStart - fBEnd) / 128.0f;
422
GLfloat fR = fRStart;
423
GLfloat fG = fGStart;
424
GLfloat fB = fBStart;
426
for (int iX = 127; iX >= 0; --iX)
421
for (iY = 0; iY < 128; iY++)
432
for (int iY = 0; iY < 128; ++iY)
423
434
aaafTextureData[iX][iY][0] = fR;
424
435
aaafTextureData[iX][iY][1] = fG;
445
456
const GLfloat angle = 2 * M_PI / (GLfloat) ((n == 0) ? 1 : n);
446
const int size = abs (n);
457
const int size = abs (n);
448
459
*ppSint = (GLfloat *) calloc (sizeof (GLfloat), size + 1);
449
460
*ppCost = (GLfloat *) calloc (sizeof (GLfloat), size + 1);
498
507
if (optionGetSkydomeAnimated ())
500
iStacksStart = 11; /* min. 0 */
501
iStacksEnd = 53; /* max. 64 */
502
iSlicesStart = 0; /* min. 0 */
503
iSlicesEnd = 128; /* max. 128 */
509
iStacksStart = 11; /* min. 0 */
510
iStacksEnd = 53; /* max. 64 */
511
iSlicesStart = 0; /* min. 0 */
512
iSlicesEnd = 128; /* max. 128 */
507
iStacksStart = 21; /* min. 0 */
508
iStacksEnd = 43; /* max. 64 */
509
iSlicesStart = 21; /* min. 0 */
510
iSlicesEnd = 44; /* max. 128 */
516
iStacksStart = 21; /* min. 0 */
517
iStacksEnd = 43; /* max. 64 */
518
iSlicesStart = 21; /* min. 0 */
519
iSlicesEnd = 44; /* max. 128 */
513
fStepX = 1.0 / (GLfloat) (iSlicesEnd - iSlicesStart);
514
fStepY = 1.0 / (GLfloat) (iStacksEnd - iStacksStart);
522
GLfloat fStepX = 1.0 / (GLfloat) (iSlicesEnd - iSlicesStart);
523
GLfloat fStepY = 1.0 / (GLfloat) (iStacksEnd - iStacksStart);
516
525
if (!mSky.size ())
546
554
glBegin (GL_QUADS);
548
for (int i = iStacksStart; i < iStacksEnd; i++)
556
for (int i = iStacksStart; i < iStacksEnd; ++i)
550
558
afTexCoordX[0] = 1.0f;
551
559
afTexCoordX[1] = 1.0f - fStepX;
552
560
afTexCoordX[2] = 1.0f - fStepX;
553
561
afTexCoordX[3] = 1.0f;
555
for (int j = iSlicesStart; j < iSlicesEnd; j++)
563
for (int j = iSlicesStart; j < iSlicesEnd; ++j)
557
565
/* bottom-right */
628
PrivateCubeScreen::setOption (const CompString &name, CompOption::Value &value)
636
PrivateCubeScreen::setOption (const CompString &name,
637
CompOption::Value &value)
631
639
unsigned int index;
633
bool rv = CubeOptions::setOption (name, value);
640
bool rv = CubeOptions::setOption (name, value);
635
642
if (!rv || !CompOption::findOption (getOptions (), name, &index))
639
647
case CubeOptions::In:
640
648
rv = updateGeometry (screen->vpSize ().width (), value.b () ? -1 : 1);
642
651
case CubeOptions::Skydome:
643
652
case CubeOptions::SkydomeImage:
644
653
case CubeOptions::SkydomeAnimated:
648
657
updateSkydomeList (1.0f);
649
658
cScreen->damageScreen ();
651
661
case CubeOptions::MultioutputMode:
652
662
updateOutputs ();
653
663
updateGeometry (screen->vpSize ().width (), mInvert);
654
664
cScreen->damageScreen ();
664
675
PrivateCubeScreen::adjustVelocity ()
666
float unfold, adjust, amount;
669
680
unfold = 1.0f - mUnfold;
671
682
unfold = 0.0f - mUnfold;
673
adjust = unfold * 0.02f * optionGetAcceleration ();
674
amount = fabs (unfold);
684
float adjust = unfold * 0.02f * optionGetAcceleration ();
685
float amount = fabs (unfold);
675
687
if (amount < 1.0f)
677
689
else if (amount > 3.0f)
680
mUnfoldVelocity = (amount * mUnfoldVelocity + adjust) /
692
mUnfoldVelocity = (amount * mUnfoldVelocity + adjust) / (amount + 2.0f);
683
694
return (fabs (unfold) < 0.002f && fabs (mUnfoldVelocity) < 0.01f);
698
amount = msSinceLastPaint * 0.2f *
700
steps = amount / (0.5f * optionGetTimestep ());
701
if (!steps) steps = 1;
702
chunk = amount / (float) steps;
706
float amount = msSinceLastPaint * 0.2f * optionGetSpeed ();
707
int steps = amount / (0.5f * optionGetTimestep ());
712
float chunk = amount / (float) steps;
706
716
mUnfold += mUnfoldVelocity * chunk;
707
718
if (mUnfold > 1.0f)
731
742
if (mRotationState == CubeScreen::RotationManual ||
732
743
(mRotationState == CubeScreen::RotationChange &&
733
744
!optionGetTransparentManualOnly ()))
735
745
opt = mLastOpacityIndex = CubeOptions::ActiveOpacity;
737
746
else if (mRotationState == CubeScreen::RotationChange)
739
747
opt = mLastOpacityIndex = CubeOptions::InactiveOpacity;
743
749
opt = CubeOptions::InactiveOpacity;
746
751
mToOpacity = (mOptions[opt].value ().f () / 100.0f) * OPAQUE;
761
topColor = optionGetTopColor ();
762
bottomColor = optionGetBottomColor ();
766
topColor = optionGetTopColor ();
767
bottomColor = optionGetBottomColor ();
764
769
mPaintAllViewports = (mDesktopOpacity != OPAQUE ||
765
770
topColor[3] != OPAQUE ||
772
PrivateCubeScreen::paint (CompOutput::ptrList &outputs, unsigned int mask)
777
PrivateCubeScreen::paint (CompOutput::ptrList &outputs,
774
780
float x, progress;
776
782
cubeScreen->cubeGetRotation (x, x, progress);
778
if (optionGetMultioutputMode () == MultioutputModeOneBigCube &&
784
if (optionGetMultioutputMode () == MultioutputModeOneBigCube &&
779
785
screen->outputDevs ().size () &&
780
(progress > 0.0f || mDesktopOpacity != OPAQUE))
786
(progress > 0.0f || mDesktopOpacity != OPAQUE))
782
788
outputs.clear ();
783
789
outputs.push_back (&screen->fullscreenOutput ());
823
829
std::vector<GLVector> &points)
825
831
WRAPABLE_HND_FUNCTN_RETURN (bool, cubeCheckOrientation, sAttrib, transform, output, points)
833
GLMatrix pm (priv->gScreen->projectionMatrix ()->getMatrix ());
826
834
GLMatrix sTransform = transform;
827
GLMatrix mvp, pm (priv->gScreen->projectionMatrix ()->getMatrix ());
828
GLVector pntA, pntB, pntC;
829
GLVector vecA, vecB, ortho;
832
837
priv->gScreen->glApplyTransform (sAttrib, output, &sTransform);
833
838
sTransform.translate (priv->mOutputXOffset, -priv->mOutputYOffset, 0.0f);
834
839
sTransform.scale (priv->mOutputXScale, priv->mOutputYScale, 1.0f);
836
mvp = pm * sTransform;
841
GLMatrix mvp = pm * sTransform;
838
pntA = mvp * points[0];
843
GLVector pntA = mvp * points[0];
840
845
if (pntA[3] < 0.0f)
843
848
pntA.homogenize ();
845
pntB = mvp * points[1];
850
GLVector pntB = mvp * points[1];
847
852
if (pntB[3] < 0.0f)
850
855
pntB.homogenize ();
852
pntC = mvp * points[2];
857
GLVector pntC = mvp * points[2];
853
858
pntC.homogenize ();
860
GLVector vecA = pntC - pntA;
861
GLVector vecB = pntC - pntB;
863
GLVector ortho = vecA ^ vecB;
860
865
if (ortho[2] > 0.0f)
872
877
WRAPABLE_HND_FUNCTN_RETURN (bool, cubeShouldPaintViewport, sAttrib, transform, output, order)
877
pointZ = priv->mInvert * priv->mDistance;
879
float pointZ = priv->mInvert * priv->mDistance;
878
880
std::vector<GLVector> vPoints;
879
881
vPoints.push_back (GLVector (-0.5, 0.0, pointZ, 1.0));
880
882
vPoints.push_back (GLVector (0.0, 0.5, pointZ, 1.0));
881
883
vPoints.push_back (GLVector (0.0, 0.0, pointZ, 1.0));
883
ftb = cubeCheckOrientation (sAttrib, transform, output, vPoints);
885
bool ftb = cubeCheckOrientation (sAttrib, transform, output, vPoints);
885
887
return (order == FTB && ftb) || (order == BTF && !ftb);
893
895
PaintOrder paintOrder,
896
if (!cubeScreen->cubeShouldPaintViewport (sAttrib, transform, outputPtr,
898
if (!cubeScreen->cubeShouldPaintViewport (sAttrib, transform, outputPtr,
900
int output = ((unsigned int) outputPtr->id () != (unsigned int) ~0)
901
? outputPtr->id () : 0;
902
int output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
903
outputPtr->id () : 0;
903
905
mPaintOrder = paintOrder;
905
907
if (mNOutput > 1)
907
int cubeOutput, dView;
909
909
/* translate to cube output */
910
cubeOutput = mOutputMask[output];
910
int cubeOutput = mOutputMask[output];
912
912
/* convert from window movement to viewport movement */
915
915
cubeOutput += dView;
964
964
GLScreenPaintAttrib sa = sAttrib;
967
int origXMoveAdd = 0; /* dx for the viewport we start
968
painting with (back-most). */
966
int origXMoveAdd = 0; // dx for the viewport we start painting with (back-most).
969
967
int iFirstSign; /* 1 if we do xMove += i first and
970
-1 if we do xMove -= i first. */
968
-1 if we do xMove -= i first. */
972
970
if (mInvert == 1)
1052
CubeScreen::cubeGetRotation (float &x, float &v, float &progress)
1052
CubeScreen::cubeGetRotation (float &x,
1054
1056
WRAPABLE_HND_FUNCTN (cubeGetRotation, x, v, progress)
1062
CubeScreen::cubeClearTargetOutput (float xRotate, float vRotate)
1064
CubeScreen::cubeClearTargetOutput (float xRotate,
1064
1067
WRAPABLE_HND_FUNCTN (cubeClearTargetOutput, xRotate, vRotate)
1076
1079
glRotatef (xRotate, 0.0f, 0.0f, -1.0f);
1080
1082
glRotatef (90.0f, 1.0f, 0.0f, 0.0f);
1083
1084
glCallList (priv->mSkyListId);
1084
1085
glPopMatrix ();
1089
1089
priv->gScreen->clearTargetOutput (GL_COLOR_BUFFER_BIT);
1100
1099
WRAPABLE_HND_FUNCTN (cubePaintTop, sAttrib, transform, output, size, normal)
1102
GLScreenPaintAttrib sa = sAttrib;
1101
GLScreenPaintAttrib sa = sAttrib;
1103
1102
GLMatrix sTransform = transform;
1105
unsigned short* color;
1108
1104
priv->gScreen->setLighting (true);
1110
color = priv->optionGetTopColor ();
1111
opacity = priv->mDesktopOpacity * color[3] / 0xffff;
1106
unsigned short *color = priv->optionGetTopColor ();
1107
int opacity = priv->mDesktopOpacity * color[3] / 0xffff;
1113
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
1109
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
1114
1110
std::vector <GLushort> colorData;
1116
1112
colorData.push_back (color[0] * opacity / 0xffff);
1168
1164
WRAPABLE_HND_FUNCTN (cubePaintBottom, sAttrib, transform, output, size, normal)
1170
GLScreenPaintAttrib sa = sAttrib;
1166
GLScreenPaintAttrib sa = sAttrib;
1171
1167
GLMatrix sTransform = transform;
1173
unsigned short* color;
1176
1169
priv->gScreen->setLighting (true);
1178
color = priv->optionGetBottomColor ();
1179
opacity = priv->mDesktopOpacity * color[3] / 0xffff;
1171
unsigned short *color = priv->optionGetBottomColor ();
1172
int opacity = priv->mDesktopOpacity * color[3] / 0xffff;
1181
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
1174
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
1182
1175
std::vector <GLushort> colorData;
1184
1177
colorData.push_back (color[0] * opacity / 0xffff);
1231
PrivateCubeScreen::glEnableOutputClipping (const GLMatrix &transform,
1224
PrivateCubeScreen::glEnableOutputClipping (const GLMatrix &transform,
1232
1225
const CompRegion ®ion,
1235
1228
if (mRotationState != CubeScreen::RotationNone)
1296
1289
CompOutput *outputPtr,
1297
1290
unsigned int mask)
1299
GLScreenPaintAttrib sa = sAttrib;
1300
float xRotate, vRotate, progress;
1303
GLenum filter = gScreen->textureFilter ();
1304
PaintOrder paintOrder;
1305
bool wasCulled = false;
1307
int cullNorm, cullInv;
1310
output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
1311
outputPtr->id () : 0;
1292
int output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
1293
outputPtr->id () : 0;
1313
1295
mReversedWindowList = cScreen->getWindowPaintList ();
1314
1296
mReversedWindowList.reverse ();
1322
1304
updateGeometry (screen->vpSize ().width (), mInvert);
1325
hsize = screen->vpSize ().width () * mNOutput;
1328
1308
glGetIntegerv (GL_CULL_FACE_MODE, &cullNorm);
1329
cullInv = (cullNorm == GL_BACK)? GL_FRONT : GL_BACK;
1330
wasCulled = glIsEnabled (GL_CULL_FACE);
1310
bool cullInv = (cullNorm == GL_BACK)? GL_FRONT : GL_BACK;
1311
bool wasCulled = glIsEnabled (GL_CULL_FACE);
1332
1313
if (!mFullscreenOutput)
1334
1315
mOutputXScale = (float) screen->width () / outputPtr->width ();
1335
1316
mOutputYScale = (float) screen->height () / outputPtr->height ();
1338
(screen->width () / 2.0f -
1339
(outputPtr->x1 () + outputPtr->x2 ()) / 2.0f) /
1340
(float) outputPtr->width ();
1318
mOutputXOffset = (screen->width () / 2.0f -
1319
(outputPtr->x1 () + outputPtr->x2 ()) / 2.0f) /
1320
(float) outputPtr->width ();
1343
(screen->height () / 2.0f -
1345
outputPtr->y2 ()) / 2.0f) /
1346
(float) outputPtr->height ();
1322
mOutputYOffset = (screen->height () / 2.0f -
1324
outputPtr->y2 ()) / 2.0f) /
1325
(float) outputPtr->height ();
1353
1332
mOutputYOffset = 0.0f;
1335
float xRotate, vRotate, progress;
1356
1336
cubeScreen->cubeGetRotation (xRotate, vRotate, progress);
1338
GLScreenPaintAttrib sa = sAttrib;
1358
1339
sa.xRotate += xRotate;
1359
1340
sa.vRotate += vRotate;
1361
1342
if (!mCleared[output])
1365
rRotate = xRotate - ((screen->vp ().x () *360.0f) / screen->vpSize ().width ());
1344
float rRotate = xRotate - ((screen->vp ().x () *360.0f) /
1345
screen->vpSize ().width ());
1367
1347
cubeScreen->cubeClearTargetOutput (rRotate, vRotate);
1368
1348
mCleared[output] = true;
1416
1401
glCullFace (cullInv);
1420
1404
/* Inside cube - start with BTF faces */
1421
1405
paintOrder = BTF;
1424
1407
if (mInvert == -1 || cubeScreen->cubeShouldPaintAllViewports ())
1425
1408
paintAllViewports (sa, transform, region, outputPtr,
1430
1413
if (wasCulled && cubeScreen->cubeShouldPaintAllViewports ())
1431
1414
glDisable (GL_CULL_FACE);
1433
paintCaps = !mGrabIndex && (hsize > 2) && !mCapsPainted[output] &&
1434
(mInvert != 1 || mDesktopOpacity != OPAQUE ||
1435
cubeScreen->cubeShouldPaintAllViewports () || sa.vRotate != 0.0f ||
1436
sa.yTranslate != 0.0f);
1416
bool paintCaps = !mGrabIndex && (hsize > 2) && !mCapsPainted[output] &&
1417
(mInvert != 1 || mDesktopOpacity != OPAQUE ||
1418
cubeScreen->cubeShouldPaintAllViewports () || sa.vRotate != 0.0f ||
1419
sa.yTranslate != 0.0f);
1440
Bool topDir, bottomDir, allCaps;
1442
1423
std::vector<GLVector> top;
1443
1424
top.push_back (GLVector (0.5, 0.5, 0.0, 1.0));
1444
1425
top.push_back (GLVector (0.0, 0.5, -0.5, 1.0));
1449
1430
bottom.push_back (GLVector (0.0, -0.5, -0.5, 1.0));
1450
1431
bottom.push_back (GLVector (0.0, -0.5, 0.0, 1.0));
1452
topDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, top);
1453
bottomDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, bottom);
1433
Bool topDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, top);
1434
Bool bottomDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, bottom);
1455
1436
mCapsPainted[output] = TRUE;
1457
allCaps = cubeScreen->cubeShouldPaintAllViewports () || mInvert != 1;
1438
Bool allCaps = cubeScreen->cubeShouldPaintAllViewports () || mInvert != 1;
1459
1440
if (topDir && bottomDir)
1463
1444
cubeScreen->cubePaintBottom (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
1464
1445
cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
1466
1448
cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
1468
1450
else if (!topDir && !bottomDir)
1472
1454
cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, 1.0f, 0.0f, 1.0f));
1473
1455
cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
1475
1458
cubeScreen->cubePaintBottom (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
1477
1460
else if (allCaps)
1555
1537
CompAction::State state,
1556
1538
CompOption::Vector &options)
1560
xid = CompOption::getIntOptionNamed (options, "root");
1540
Window xid = CompOption::getIntOptionNamed (options, "root");
1562
1542
if (::screen->root () == xid)
1564
1544
CUBE_SCREEN (screen);
1566
if (screen->vpSize ().width () * cs->priv->mNOutput < 4)
1569
if (screen->otherGrabExist ("rotate", "switcher", "cube", NULL))
1546
if (screen->vpSize ().width () * cs->priv->mNOutput < 4 ||
1547
screen->otherGrabExist ("rotate", "switcher", "cube", NULL))
1572
1550
if (!cs->priv->mGrabIndex)
1593
1571
CompAction::State state,
1594
1572
CompOption::Vector &options)
1597
xid = CompOption::getIntOptionNamed (options, "root");
1574
Window xid = CompOption::getIntOptionNamed (options, "root");
1599
1576
if (!xid || ::screen->root () == xid)
1625
PrivateCubeScreen::setOptionForPlugin (const char *plugin,
1602
PrivateCubeScreen::setOptionForPlugin (const char *plugin,
1627
1604
CompOption::Value &v)
1631
status = screen->setOptionForPlugin (plugin, name, v);
1635
if (strcmp (plugin, "core") == 0 && strcmp (name, "hsize") == 0)
1636
updateGeometry (screen->vpSize ().width (), mInvert);
1606
bool status = screen->setOptionForPlugin (plugin, name, v);
1609
strcmp (plugin, "core") == 0 &&
1610
strcmp (name, "hsize") == 0)
1611
updateGeometry (screen->vpSize ().width (), mInvert);
1644
1618
gScreen (GLScreen::get (s)),
1645
1619
cubeScreen (CubeScreen::get (s))
1653
for (int i = 0; i < 8; i++)
1626
for (int i = 0; i < 8; ++i)
1656
1629
mNVertices = 0;