diff --git a/include/core/abiversion.h b/include/core/abiversion.h index 06a7494ef33b05c09b9092da693b412f4315b350..efb6aa4ae4da645fe95912203593316fcfe0d9c4 100644 --- a/include/core/abiversion.h +++ b/include/core/abiversion.h @@ -5,6 +5,6 @@ # error Conflicting definitions of CORE_ABIVERSION #endif -#define CORE_ABIVERSION 20170630 +#define CORE_ABIVERSION 20180221 #endif // COMPIZ_ABIVERSION_H diff --git a/plugins/animationaddon/src/beamup.cpp b/plugins/animationaddon/src/beamup.cpp index 8871ff138434a0f73d1a750b01cc58dc920f2bd8..59c31dd095b7132af8a70743b4a3dfb29b7fc341 100644 --- a/plugins/animationaddon/src/beamup.cpp +++ b/plugins/animationaddon/src/beamup.cpp @@ -181,7 +181,7 @@ BeamUpAnim::step () } else { - mDrawRegion = emptyRegion; + mDrawRegion = CompRegion::empty (); } mUseDrawRegion = (fabs (newProgress) > 1e-5); diff --git a/plugins/animationaddon/src/burn.cpp b/plugins/animationaddon/src/burn.cpp index b524fa36b081ae9875ad27e393b18f48fb2a9133..cddf35d56db878dade6570ae865ca44072e9aa43 100644 --- a/plugins/animationaddon/src/burn.cpp +++ b/plugins/animationaddon/src/burn.cpp @@ -326,7 +326,7 @@ BurnAnim::step () } else { - mDrawRegion = emptyRegion; + mDrawRegion = CompRegion::empty (); } mUseDrawRegion = (fabs (newProgress) > 1e-5); diff --git a/plugins/animationaddon/src/particle.cpp b/plugins/animationaddon/src/particle.cpp index 2b0360a30711b64121fdcc1a4e2962541f62804d..a0925dab6d3ff8c70a06da4c3b9f7dcc1ccbe286 100644 --- a/plugins/animationaddon/src/particle.cpp +++ b/plugins/animationaddon/src/particle.cpp @@ -297,7 +297,7 @@ ParticleAnim::updateBB (CompOutput &output) } } - if (mUseDrawRegion && mDrawRegion != emptyRegion) + if (mUseDrawRegion && mDrawRegion != CompRegion::empty ()) // expand BB with bounding box of draw region mAWindow->expandBBWithBox (mDrawRegion.handle ()->extents); else // drawing full window diff --git a/plugins/animationplus/src/bonanza.cpp b/plugins/animationplus/src/bonanza.cpp index 12f372647b9cdd0e97f54e3ebc4ab1dea6d1068f..656bc62d3c676000036159d2d4a5d736caba8db4 100644 --- a/plugins/animationplus/src/bonanza.cpp +++ b/plugins/animationplus/src/bonanza.cpp @@ -208,12 +208,12 @@ BonanzaAnim::step (float time) } Region pointsRegion = XPolygonRegion (&pts[0], 20, WindingRule);; - mDrawRegion = CompRegionRef(pointsRegion) - emptyRegion.united (rect); + mDrawRegion = CompRegionRef(pointsRegion) - CompRegion::empty ().united (rect); XDestroyRegion (pointsRegion); } else { - mDrawRegion = emptyRegion; + mDrawRegion = CompRegion::empty (); } diff --git a/plugins/blur/src/blur.cpp b/plugins/blur/src/blur.cpp index a0f79921f4f00b83b390fa1c978cf8d29f14c919..00b8efa49bce5291b64d7fd5633bce6fff3aaf64 100644 --- a/plugins/blur/src/blur.cpp +++ b/plugins/blur/src/blur.cpp @@ -449,7 +449,7 @@ BlurScreen::damageCutoff () * and then use the real damage in order to determine what blur regions * should be updated */ - backbufferUpdateRegionThisFrame &= emptyRegion; + backbufferUpdateRegionThisFrame &= CompRegion::empty (); CompRegion frameAgeDamage = damageQuery->damageForFrameAge (cScreen->getFrameAge ()); foreach (CompWindow *w, screen->windows ()) { @@ -466,7 +466,7 @@ BlurScreen::damageCutoff () continue; if (!bw->projectedBlurRegion.isEmpty ()) - bw->projectedBlurRegion &= emptyRegion; + bw->projectedBlurRegion &= CompRegion::empty (); GLMatrix screenSpace; screenSpace.toScreenSpace (this->output, -DEFAULT_Z_CAMERA); @@ -561,7 +561,7 @@ BlurWindow::glTransformationComplete (const GLMatrix &matrix, clientThreshold = 0; if (mask & PAINT_WINDOW_TRANSFORMED_MASK) - reg = &infiniteRegion; + reg = &CompRegion::infinite (); else reg = ®ion; @@ -1218,7 +1218,7 @@ BlurWindow::projectRegion (CompOutput *output, GLTexture::MatrixList ml; gWindow->vertexBuffer ()->begin (); - gWindow->glAddGeometry (ml, bScreen->tmpRegion2, infiniteRegion); + gWindow->glAddGeometry (ml, bScreen->tmpRegion2, CompRegion::infinite ()); if (!gWindow->vertexBuffer ()->end ()) return; @@ -1627,7 +1627,7 @@ BlurWindow::glDraw (const GLMatrix &transform, const CompRegion *reg = NULL; if (mask & PAINT_WINDOW_TRANSFORMED_MASK) - reg = &infiniteRegion; + reg = &CompRegion::infinite (); else reg = ®ion; diff --git a/plugins/compiztoolbox/src/compiztoolbox.cpp b/plugins/compiztoolbox/src/compiztoolbox.cpp index 71aab9c9844a3f8774d5667f6602082746917438..42bd184cf411fafe9b011e9fade564d08ef150d6 100644 --- a/plugins/compiztoolbox/src/compiztoolbox.cpp +++ b/plugins/compiztoolbox/src/compiztoolbox.cpp @@ -504,7 +504,7 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib, very ugly but necessary until the vertex stage has been made fully pluggable. */ gWindow->glAddGeometrySetCurrentIndex (MAXSHORT); - gWindow->glDraw (wTransform, sAttrib, infiniteRegion, mask); + gWindow->glDraw (wTransform, sAttrib, CompRegion::infinite (), mask); gWindow->glAddGeometrySetCurrentIndex (addWindowGeometryIndex); gScreen->setTextureFilter (filter); @@ -552,7 +552,7 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib, gWindow->vertexBuffer ()->begin (); gWindow->glAddGeometrySetCurrentIndex (MAXSHORT); - gWindow->glAddGeometry (matrix, iconReg, infiniteRegion); + gWindow->glAddGeometry (matrix, iconReg, CompRegion::infinite ()); gWindow->glAddGeometrySetCurrentIndex (addWindowGeometryIndex); if (gWindow->vertexBuffer ()->end ()) diff --git a/plugins/composite/src/backbuffertracking/tests/test-composite-backbuffertracking.cpp b/plugins/composite/src/backbuffertracking/tests/test-composite-backbuffertracking.cpp index bc8922a8a5385b1bfe2df29e26e938a0f810d6c7..2003a63edf1104f1d4247bb60d84ef503cfb8cdd 100644 --- a/plugins/composite/src/backbuffertracking/tests/test-composite-backbuffertracking.cpp +++ b/plugins/composite/src/backbuffertracking/tests/test-composite-backbuffertracking.cpp @@ -181,7 +181,7 @@ TEST_F (BackbufferTrackingCallbacks, NoTrackIntoCurrentIfCallbackFalse) allowDamage (false); CompRegion damage (100, 100, 100, 100); roster->dirtyAreaOnCurrentFrame (damage); - EXPECT_EQ (emptyRegion, roster->currentFrameDamage ()); + EXPECT_EQ (CompRegion::empty (), roster->currentFrameDamage ()); } TEST_F (BackbufferTracking, DirtyAreaSubtraction) @@ -210,7 +210,7 @@ TEST_F (BackbufferTracking, NoDirtyAreaForLastFrame) CompRegion all (0, 0, screen.width (), screen.height ()); roster->dirtyAreaOnCurrentFrame (all); roster->incrementFrameAges (); - EXPECT_EQ (emptyRegion, roster->damageForFrameAge (1)); + EXPECT_EQ (CompRegion::empty (), roster->damageForFrameAge (1)); } TEST_F (BackbufferTracking, DirtyAreaIfMoreSinceLastFrame) @@ -429,21 +429,21 @@ TEST_F (AgeingDamageBuffers, DirtyAreaOnInvalidRosters) { EXPECT_CALL (mockDamageAgeTracker, dirtyAreaOnCurrentFrame (_)).Times (0); ageing.unobserve (mockDamageAgeTracker); - ageing.markAreaDirty (emptyRegion); + ageing.markAreaDirty (CompRegion::empty ()); } TEST_F (AgeingDamageBuffers, SubtractObscuredAreaOnInvalidRosters) { EXPECT_CALL (mockDamageAgeTracker, subtractObscuredArea (_)).Times (0); ageing.unobserve (mockDamageAgeTracker); - ageing.subtractObscuredArea (emptyRegion); + ageing.subtractObscuredArea (CompRegion::empty ()); } TEST_F (AgeingDamageBuffers, AddOverdrawAreaOnInvalidRosters) { EXPECT_CALL (mockDamageAgeTracker, overdrawRegionOnPaintingFrame (_)).Times (0); ageing.unobserve (mockDamageAgeTracker); - ageing.markAreaDirtyOnLastFrame (emptyRegion); + ageing.markAreaDirtyOnLastFrame (CompRegion::empty ()); } diff --git a/plugins/decor/src/clip-groups/src/clip-groups.cpp b/plugins/decor/src/clip-groups/src/clip-groups.cpp index 953743cb8856a1343df67d259a7ccb6483954adc..dece6199cfc7f8c4102839c5bd22f093638c3a57 100644 --- a/plugins/decor/src/clip-groups/src/clip-groups.cpp +++ b/plugins/decor/src/clip-groups/src/clip-groups.cpp @@ -41,7 +41,7 @@ GenericDecorClipGroup::doPopClippable (DecorClippableInterface *dc) if (it != mClippables.end ()) { dc->setOwner (NULL); - dc->updateShadow (emptyRegion); + dc->updateShadow (CompRegion::empty ()); mClippables.erase (it); regenerateClipRegion (); @@ -54,7 +54,7 @@ GenericDecorClipGroup::doPopClippable (DecorClippableInterface *dc) void GenericDecorClipGroup::doRegenerateClipRegion () { - mRegion -= infiniteRegion; + mRegion -= CompRegion::infinite (); foreach (DecorClippableInterface *clippable, mClippables) { diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp index 2f93f9d882ae6fb253244a439db89a49884edebe..b0be105ae43740be0660df8e18b667260313dcd4 100644 --- a/plugins/decor/src/decor.cpp +++ b/plugins/decor/src/decor.cpp @@ -253,7 +253,7 @@ DecorWindow::glDecorate (const GLMatrix &transform, PAINT_WINDOW_WITH_OFFSET_MASK))) preg = ®ion; else if (mask & PAINT_WINDOW_TRANSFORMED_MASK) - preg = &infiniteRegion; + preg = &CompRegion::infinite (); else if (mClipGroup) { tmpRegion = mOutputRegion; diff --git a/plugins/expo/src/expo.cpp b/plugins/expo/src/expo.cpp index 14108f5b8ad77b9c4229bd8809ff1f0446c86bc7..86c1618ba89f70ab033695b28ac237eda629a2fe 100644 --- a/plugins/expo/src/expo.cpp +++ b/plugins/expo/src/expo.cpp @@ -1336,7 +1336,7 @@ ExpoWindow::glDraw (const GLMatrix &transform, /* reset geometry and paint */ gWindow->vertexBuffer ()->begin (); gWindow->vertexBuffer ()->end (); - paintGlow (transform, attrib, infiniteRegion, mask); + paintGlow (transform, attrib, CompRegion::infinite (), mask); } return status; diff --git a/plugins/group/src/paint.cpp b/plugins/group/src/paint.cpp index 6b13c1d9872ee0e15934093c9bf7f8a4f705108b..4bf87d90dde16a89adb7cc0c9af5d0a178cad1ca 100644 --- a/plugins/group/src/paint.cpp +++ b/plugins/group/src/paint.cpp @@ -829,7 +829,7 @@ GroupWindow::glDraw (const GLMatrix &transform, if (mGroup && (mGroup->mWindows.size () > 1) && mGlowQuads) { if (mask & PAINT_WINDOW_TRANSFORMED_MASK) - paintRegion = CompRegion (infiniteRegion); + paintRegion = CompRegion (CompRegion::infinite ()); if (paintRegion.numRects ()) { diff --git a/plugins/group/src/selection.cpp b/plugins/group/src/selection.cpp index 5b7fcb91dc714d00f921a28c91e70650332307c0..41e4658cad6e1f499adb7a1b5d09f49d59425129 100644 --- a/plugins/group/src/selection.cpp +++ b/plugins/group/src/selection.cpp @@ -249,7 +249,7 @@ Selection::selectRegion () MIN (mY1, mY2) + 4; rect = CompRect (x, y, width, height); - reg = emptyRegion.united (rect); + reg = CompRegion::empty ().united (rect); gs->cScreen->damageRegion (reg); diff --git a/plugins/group/src/tab.cpp b/plugins/group/src/tab.cpp index 2014f5c7121dda061b5ad81558d0571f30e9655b..fedc62f8220be6aff429f8ac5f4d216f0cb24220 100644 --- a/plugins/group/src/tab.cpp +++ b/plugins/group/src/tab.cpp @@ -2015,7 +2015,7 @@ GroupScreen::recalcSlotPos (GroupTabBarSlot *slot, space = optionGetThumbSpace (); thumbSize = optionGetThumbSize (); - slot->mRegion = emptyRegion; + slot->mRegion = CompRegion::empty (); /* Padding between slots, account for this */ box.setX (space + ((thumbSize + space) * slotPos)); diff --git a/plugins/imgsvg/src/imgsvg.cpp b/plugins/imgsvg/src/imgsvg.cpp index 0150fd4d0994c3c4d2864ef3bb8ce0c562646cc6..7d77a0fc8e1663728b5ae7004867c23fd88ba125 100644 --- a/plugins/imgsvg/src/imgsvg.cpp +++ b/plugins/imgsvg/src/imgsvg.cpp @@ -230,7 +230,7 @@ SvgWindow::glDraw (const GLMatrix &transform, return status; const CompRegion ® = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? - infiniteRegion : region; + CompRegion::infinite () : region; if (context && reg.numRects ()) { diff --git a/plugins/kdecompat/src/kdecompat.cpp b/plugins/kdecompat/src/kdecompat.cpp index 93bcd619d5130c7a2becf8d99522215aa10404fc..4cc8d3ae18fbfa061ceed8d5fba2098b7b4806dc 100644 --- a/plugins/kdecompat/src/kdecompat.cpp +++ b/plugins/kdecompat/src/kdecompat.cpp @@ -323,7 +323,7 @@ KDECompatWindow::glPaint (const GLWindowPaintAttrib &attrib, matrices[0].y0 -= (tw->y () * icon->matrix ().yy); gtw->vertexBuffer ()->begin (); - gtw->glAddGeometry (matrices, tw->geometry (), infiniteRegion); + gtw->glAddGeometry (matrices, tw->geometry (), CompRegion::infinite ()); gtw->vertexBuffer ()->end (); } } @@ -343,7 +343,7 @@ KDECompatWindow::glPaint (const GLWindowPaintAttrib &attrib, if (!gtw->textures ().empty ()) gtw->glDraw (wTransform, attrib, - infiniteRegion, paintMask); + CompRegion::infinite (), paintMask); else if (icon) gtw->glDrawTexture (icon, wTransform, attrib, paintMask); } diff --git a/plugins/opacify/src/opacify.cpp b/plugins/opacify/src/opacify.cpp index 0d84af95e298c87cf0e63c3907b010b534709a63..94c3af7ff926e812a50272be33d68bac439f371f 100644 --- a/plugins/opacify/src/opacify.cpp +++ b/plugins/opacify/src/opacify.cpp @@ -407,7 +407,7 @@ OpacifyScreen::OpacifyScreen (CompScreen *screen) : isToggle (optionGetInitToggle ()), newActive (NULL), active (screen->activeWindow ()), - intersect (emptyRegion), + intersect (CompRegion::empty ()), justMoved (false) { ScreenInterface::setHandler (screen, false); diff --git a/plugins/opengl/src/paint.cpp b/plugins/opengl/src/paint.cpp index 5ed2236580ba59e36f8bc717b6b10217cd9a5968..e4e98082ce8326e0ef5b672f2e7fc7e04f2137a6 100644 --- a/plugins/opengl/src/paint.cpp +++ b/plugins/opengl/src/paint.cpp @@ -1315,7 +1315,7 @@ GLWindow::glDraw (const GLMatrix &transform, attrib, region, mask) const CompRegion ® = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? - infiniteRegion : region; + CompRegion::infinite () : region; if (reg.isEmpty ()) return true; diff --git a/plugins/resize/src/logic/src/resize-logic.cpp b/plugins/resize/src/logic/src/resize-logic.cpp index d0222d8c9e8287db20472c084d195a25ca7467e0..a37e3d23546d5d125d224fdce0b114bb2108eccc 100644 --- a/plugins/resize/src/logic/src/resize-logic.cpp +++ b/plugins/resize/src/logic/src/resize-logic.cpp @@ -1440,7 +1440,7 @@ ResizeLogic::initiateResize (CompAction *action, lastGoodSize = w->serverSize (); /* Combine the work areas of all outputs */ - constraintRegion = emptyRegion; + constraintRegion = CompRegion::empty (); foreach (CompOutput &output, mScreen->outputDevs ()) constraintRegion += output.workArea (); } diff --git a/plugins/ring/src/ring.cpp b/plugins/ring/src/ring.cpp index eac2b28e2c8944f134a3ab8b4d7cd585025cccd7..7be912da5d642b6f410dc1ee493bc520cacc093e 100644 --- a/plugins/ring/src/ring.cpp +++ b/plugins/ring/src/ring.cpp @@ -768,7 +768,7 @@ RingScreen::glPaintOutput (const GLScreenPaintAttrib &attrib, RING_WINDOW (w); status |= rw->gWindow->glPaint (rw->gWindow->paintAttrib (), - sTransform, infiniteRegion, 0); + sTransform, CompRegion::infinite (), 0); } if (mState != RingStateIn) diff --git a/plugins/shift/src/shift.cpp b/plugins/shift/src/shift.cpp index 189b077dc1d98482f48a73f29773800adacbb07a..8245240f48ace92acf8fa2085dede47588d38ca8 100644 --- a/plugins/shift/src/shift.cpp +++ b/plugins/shift/src/shift.cpp @@ -1155,7 +1155,7 @@ ShiftScreen::glPaintOutput (const GLScreenPaintAttrib &attrib, mActiveSlot = &mDrawSlots[i]; { sw->gWindow->glPaint (sw->gWindow->paintAttrib (), rTransform, - infiniteRegion, 0); + CompRegion::infinite (), 0); } } @@ -1248,7 +1248,7 @@ ShiftScreen::glPaintOutput (const GLScreenPaintAttrib &attrib, mActiveSlot = &mDrawSlots[i]; { sw->gWindow->glPaint (sw->gWindow->paintAttrib (), sTransform, - infiniteRegion, 0); + CompRegion::infinite (), 0); } } @@ -1288,7 +1288,7 @@ ShiftScreen::glPaintOutput (const GLScreenPaintAttrib &attrib, SHIFT_WINDOW (w); sw->gWindow->glPaint (sw->gWindow->paintAttrib (), sTransform, - infiniteRegion, 0); + CompRegion::infinite (), 0); } mPaintingAbove = false; diff --git a/plugins/stackswitch/src/stackswitch.cpp b/plugins/stackswitch/src/stackswitch.cpp index 31eddc32515d10190ee093f997ddd6ea7ba8a9d0..ee1c54aa524f27d8dedd82696caee075d34d9f92 100644 --- a/plugins/stackswitch/src/stackswitch.cpp +++ b/plugins/stackswitch/src/stackswitch.cpp @@ -380,7 +380,7 @@ StackswitchWindow::glPaint (const GLWindowPaintAttrib &attrib, matl.push_back (matrix); gWindow->geometry ().reset (); - gWindow->glAddGeometry (matl, iconReg, infiniteRegion); + gWindow->glAddGeometry (matl, iconReg, CompRegion::infinite ()); if (gWindow->geometry ().vCount) { @@ -888,7 +888,7 @@ StackswitchScreen::glPaintOutput (const GLScreenPaintAttrib &attrib, STACKSWITCH_WINDOW (w); - sw->gWindow->glPaint (sw->gWindow->paintAttrib (), sTransform, infiniteRegion, 0); + sw->gWindow->glPaint (sw->gWindow->paintAttrib (), sTransform, CompRegion::infinite (), 0); } } diff --git a/plugins/staticswitcher/src/staticswitcher.cpp b/plugins/staticswitcher/src/staticswitcher.cpp index 8c5389de2777ede94599883bacd3bb083dc12851..452e1bef7f54c19b18fc460ac79258ba3d892b31 100644 --- a/plugins/staticswitcher/src/staticswitcher.cpp +++ b/plugins/staticswitcher/src/staticswitcher.cpp @@ -965,7 +965,7 @@ StaticSwitchScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib, sw->cWindow->damaged ()) { sw->gWindow->glPaint (sw->gWindow->paintAttrib (), - sTransform, infiniteRegion, 0); + sTransform, CompRegion::infinite (), 0); } } } diff --git a/plugins/switcher/src/switcher.cpp b/plugins/switcher/src/switcher.cpp index d9bc86d1a2b039b43d68547aba4326b8c2036bdd..122f3674d1e1b72d88baf73a9281da06e8fb4b53 100644 --- a/plugins/switcher/src/switcher.cpp +++ b/plugins/switcher/src/switcher.cpp @@ -790,7 +790,7 @@ SwitchScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib, sw->cWindow->damaged ()) { sw->gWindow->glPaint (sw->gWindow->paintAttrib (), - sTransform, infiniteRegion, 0); + sTransform, CompRegion::infinite (), 0); } } } diff --git a/plugins/td/src/3d.cpp b/plugins/td/src/3d.cpp index 2061c49fc97613a2424ec23ad2a31d49d8a5b0d8..ad593b1223d090cc06247578bbb16b54c92a7dde 100644 --- a/plugins/td/src/3d.cpp +++ b/plugins/td/src/3d.cpp @@ -458,7 +458,7 @@ TdScreen::cubePaintViewport (const GLScreenPaintAttrib &attrib, GL::shaders = false; tdw->gWindow->glPaint (tdw->gWindow->paintAttrib (), mTransform, - infiniteRegion, newMask); + CompRegion::infinite (), newMask); GL::shaders = true; gScreen->glDisableOutputClipping (); diff --git a/plugins/thumbnail/src/thumbnail.cpp b/plugins/thumbnail/src/thumbnail.cpp index 584e04894646bfd075c9514108bd2b247b8e9309..5a8303d049310096f1363b4720ec22acf13c4dbc 100644 --- a/plugins/thumbnail/src/thumbnail.cpp +++ b/plugins/thumbnail/src/thumbnail.cpp @@ -908,7 +908,7 @@ ThumbScreen::thumbPaintThumb (Thumbnail *t, very ugly but necessary until the vertex stage has been made fully pluggable. */ gWindow->glAddGeometrySetCurrentIndex (MAXSHORT); - gWindow->glDraw (wTransform, sAttrib, infiniteRegion, mask); + gWindow->glDraw (wTransform, sAttrib, CompRegion::infinite (), mask); gScreen->setTextureFilter (filter); } diff --git a/plugins/wallpaper/src/wallpaper.cpp b/plugins/wallpaper/src/wallpaper.cpp index 289e9497e344bd3056e3f4028e7c098699f5d2ea..24265abdcccb854c9a676cc11405042970c66519 100644 --- a/plugins/wallpaper/src/wallpaper.cpp +++ b/plugins/wallpaper/src/wallpaper.cpp @@ -450,7 +450,7 @@ WallpaperWindow::drawBackgrounds (const GLMatrix &transform, gWindow->glAddGeometry (tmpMatrixList, screen->region (), (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? - infiniteRegion : region); + CompRegion::infinite () : region); if (ws->optionGetCycleWallpapers ()) tmpAttrib.opacity *= fadingIn ? (1.0f - ws->alpha) : ws->alpha; diff --git a/src/region/include/core/region.h b/src/region/include/core/region.h index 4412d0288fd4cbe0cff48f279eac1dc640f47e95..e5968c5c6b516513255ab57d6043ac8159619037 100644 --- a/src/region/include/core/region.h +++ b/src/region/include/core/region.h @@ -52,6 +52,9 @@ class CompRegion { CompRegion (const CompRect &); ~CompRegion (); + static const CompRegion &infinite(); + static const CompRegion &empty(); + /** * Returns a CompRect which encapsulates a given CompRegion */ @@ -193,7 +196,4 @@ class CompRegionRef : public CompRegion ~CompRegionRef (); }; -extern const CompRegion infiniteRegion; -extern const CompRegion emptyRegion; - #endif diff --git a/src/region/src/region.cpp b/src/region/src/region.cpp index c705510895f832f4de269ceef7b603a3cc32f2c4..0eec7f2a1a932bdd04272a8aae527e11147c4d15 100644 --- a/src/region/src/region.cpp +++ b/src/region/src/region.cpp @@ -38,19 +38,21 @@ template class std::vector; -const CompRegion infiniteRegion (CompRect (MINSHORT, MINSHORT, - MAXSHORT * 2, MAXSHORT * 2)); -const CompRegion emptyRegion; - -/* Alternate emptyRegion, mostly just required to construct infiniteRegion - when emptyRegion may still be uninitialized */ -static const CompRegion & -_emptyRegion () +const CompRegion & +CompRegion::empty () { static const CompRegion r; return r; } +const CompRegion & +CompRegion::infinite () +{ + static const CompRegion r(CompRect (MINSHORT, MINSHORT, + MAXSHORT * 2, MAXSHORT * 2)); + return r; +} + CompRegion::CompRegion () { init (); @@ -59,7 +61,7 @@ CompRegion::CompRegion () CompRegion::CompRegion (const CompRegion &c) { init (); - XUnionRegion (_emptyRegion ().handle (), c.handle (), handle ()); + XUnionRegion (empty ().handle (), c.handle (), handle ()); } CompRegion::CompRegion ( int x, int y, int w, int h) @@ -73,7 +75,7 @@ CompRegion::CompRegion ( int x, int y, int w, int h) rect.width = w; rect.height = h; - XUnionRectWithRegion (&rect, _emptyRegion ().handle (), handle ()); + XUnionRectWithRegion (&rect, empty ().handle (), handle ()); } CompRegion::CompRegion (const CompRect &r) @@ -87,7 +89,7 @@ CompRegion::CompRegion (const CompRect &r) rect.width = r.width (); rect.height = r.height (); - XUnionRectWithRegion (&rect, _emptyRegion ().handle (), handle ()); + XUnionRectWithRegion (&rect, empty ().handle (), handle ()); } CompRegion::CompRegion (Region external) @@ -129,7 +131,7 @@ CompRegion::handle () const CompRegion & CompRegion::operator= (const CompRegion &c) { - XUnionRegion (emptyRegion.handle (), c.handle (), handle ()); + XUnionRegion (empty ().handle (), c.handle (), handle ()); return *this; } diff --git a/src/window.cpp b/src/window.cpp index 12b31e80e42308650a4f7d67156a33f54b366f47..7ae1087998e6f78034ad936763c69f4044f34be0 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -950,7 +950,7 @@ PrivateWindow::updateRegion () const CompWindow::Geometry &geom = attrib.override_redirect ? priv->geometry : priv->serverGeometry; - priv->region = priv->inputRegion = emptyRegion; + priv->region = priv->inputRegion = CompRegion::empty (); r.x = -geom.border (); r.y = -geom.border (); @@ -6658,7 +6658,7 @@ CompWindow::updateFrameRegion () { if (priv->serverFrame) { - priv->frameRegion = emptyRegion; + priv->frameRegion = CompRegion::empty (); updateFrameRegion (priv->frameRegion);