vcl/headless/CairoCommon.cxx | 14 +++----------- vcl/source/window/cursor.cxx | 8 +++++++- 2 files changed, 10 insertions(+), 12 deletions(-)
New commits: commit 6dc41e33e087032a52ee11832ff1299632b4f5dd Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon May 9 17:34:46 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon May 9 22:30:22 2022 +0200 Related: tdf#148433 experiment with SAL_DISABLE_CURSOR_INDICATOR to turn off the arrow indicators in BiDi cursor Change-Id: I5ed96bccf17432e63564bdfc1c7d2ad4fecdd2a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134090 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx index 2e2dcaecec6f..73a6b72f802e 100644 --- a/vcl/headless/CairoCommon.cxx +++ b/vcl/headless/CairoCommon.cxx @@ -960,16 +960,8 @@ cairo_pattern_t* create_stipple() } } // end anonymous ns -namespace -{ -// check for env var that deciding to disable CAIRO_OPERATOR_DIFFERENCE -const char* pDisableDifference(getenv("SAL_DISABLE_CAIRO_DIFFERENCE")); -bool bDisableDifference(nullptr != pDisableDifference); -} - #if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) #define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23)) -#define CAIRO_OPERATOR_EXCLUSION (static_cast<cairo_operator_t>(24)) #endif void CairoCommon::invert(const basegfx::B2DPolygon& rPoly, SalInvert nFlags, bool bAntiAlias) @@ -984,13 +976,13 @@ void CairoCommon::invert(const basegfx::B2DPolygon& rPoly, SalInvert nFlags, boo cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); - if (bDisableDifference) + if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0)) { - cairo_set_operator(cr, CAIRO_OPERATOR_EXCLUSION); + cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); } else { - cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); + SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, archaic cairo"); } if (nFlags & SalInvert::TrackFrame) diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 6a186da9432c..406491ed1d65 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -43,6 +43,12 @@ struct ImplCursorData VclPtr<vcl::Window> mpWindow; // assigned window }; +namespace +{ +const char* pDisableCursorIndicator(getenv("SAL_DISABLE_CURSOR_INDICATOR")); +bool bDisableCursorIndicator(nullptr != pDisableCursorIndicator); +} + static tools::Rectangle ImplCursorInvert(vcl::RenderContext* pRenderContext, ImplCursorData const * pData) { tools::Rectangle aPaintRect; @@ -65,7 +71,7 @@ static tools::Rectangle ImplCursorInvert(vcl::RenderContext* pRenderContext, Imp aPoly[2].AdjustX(1 ); // apply direction flag after slant to use the correct shape - if ( pData->mnDirection != CursorDirection::NONE) + if (!bDisableCursorIndicator && pData->mnDirection != CursorDirection::NONE) { Point pAry[7]; // Related system settings for "delta" could be: