diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index c40cd6a789..20649b537e 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -561,7 +561,7 @@ public: } } - if (! usingXShm) + if (! isUsingXShm()) #endif { imageDataAllocated.allocate (lineStride * h, format == Image::ARGB && clearImage); @@ -614,7 +614,7 @@ public: XFreeGC (display, gc); #if JUCE_USE_XSHM - if (usingXShm) + if (isUsingXShm()) { XShmDetach (display, &segmentInfo); @@ -709,13 +709,17 @@ public: // blit results to screen. #if JUCE_USE_XSHM - if (usingXShm) + if (isUsingXShm()) XShmPutImage (display, (::Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh, True); else #endif XPutImage (display, (::Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh); } + #if JUCE_USE_XSHM + bool isUsingXShm() const noexcept { return usingXShm; } + #endif + private: //============================================================================== XImage* xImage; @@ -1926,15 +1930,16 @@ private: for (const Rectangle* i = originalRepaintRegion.begin(), * const e = originalRepaintRegion.end(); i != e; ++i) { + XBitmapImage* xbitmap = static_cast (image.getPixelData()); #if JUCE_USE_XSHM - if (XSHMHelpers::isShmAvailable()) + if (xbitmap->isUsingXShm()) ++shmPaintsPending; #endif - static_cast (image.getPixelData()) - ->blitToWindow (peer.windowH, - i->getX(), i->getY(), i->getWidth(), i->getHeight(), - i->getX() - totalArea.getX(), i->getY() - totalArea.getY()); + + xbitmap->blitToWindow (peer.windowH, + i->getX(), i->getY(), i->getWidth(), i->getHeight(), + i->getX() - totalArea.getX(), i->getY() - totalArea.getY()); } }