From 26462f9c4c31a691cf98526c4cea23afee79bcc6 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 7 Mar 2019 09:54:30 +0100 Subject: 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 --- src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp') diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp index ed482e5dae..bbc156fc53 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp @@ -192,6 +192,10 @@ bool QXcbNativeBackingStore::scroll(const QRegion &area, int dx, int dy) void QXcbNativeBackingStore::beginPaint(const QRegion ®ion) { + QX11PlatformPixmap *x11pm = qt_x11Pixmap(m_pixmap); + if (x11pm) + x11pm->setIsBackingStore(true); + #if QT_CONFIG(xrender) if (m_translucentBackground) { const QVector xrects = qt_region_to_xrectangles(region); -- cgit v1.2.3