path: root/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
diff options
authorEskil Abrahamsen Blomfeldt <>2019-03-07 09:54:30 +0100
committerEskil Abrahamsen Blomfeldt <>2019-03-20 13:07:00 +0000
commit26462f9c4c31a691cf98526c4cea23afee79bcc6 (patch)
tree0b3dc4b0f2dbac0ec545f19381a35b37fecad582 /src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
parentb0145f029cdde7ae8475b85a20099f115879496e (diff)
X11PaintEngine: Don't use system clip for non-system painting
When painting into a pixmap, we would apply the system clip, which is a rectangle that starts at the position of the current widget relative to the window. If the widget was not positioned at (0,0), we would therefore clip the top left part of the drawing when drawing into a pixmap, which is obviously not intentional. The solution is in accordance with how it is done in e.g. the OpenGL paint engine, where useSystemClip is set to true only if we are drawing to a widget. The system clip should otherwise be ignored, so we do that in the X11 paint engine as well. Task-number: QTBUG-70387 Change-Id: I9cad26019970280a8a452dc6f1015d229120cac5 Reviewed-by: Eskil Abrahamsen Blomfeldt <>
Diffstat (limited to 'src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp')
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
index 86c87e5e30..b1ce39f363 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
@@ -1772,6 +1772,20 @@ XID QX11PlatformPixmap::createBitmapFromImage(const QImage &image)
return hd;
+bool QX11PlatformPixmap::isBackingStore() const
+ return (flags & IsBackingStore);
+void QX11PlatformPixmap::setIsBackingStore(bool on)
+ if (on)
+ flags |= IsBackingStore;
+ else {
+ flags &= ~IsBackingStore;
+ }
#if QT_CONFIG(xrender)
void QX11PlatformPixmap::convertToARGB32(bool preserveContents)