diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-03-07 09:54:30 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-03-20 13:07:00 +0000 |
commit | 26462f9c4c31a691cf98526c4cea23afee79bcc6 (patch) | |
tree | 0b3dc4b0f2dbac0ec545f19381a35b37fecad582 /src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp | |
parent | b0145f029cdde7ae8475b85a20099f115879496e (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 <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<XRectangle> xrects = qt_region_to_xrectangles(region); |