xcb: Fix flushing of native subwindows when not using shared memory
When using X-forwarding we're not using shared memory for the backing store image, and end up in a code path where we first copy the updated parts of the backing store from our client side image over to the server, and then flush those parts from the server-side image to the window. The problem was that this code path didn't account for the possibility that we'd flush a sub-window at an offset, and would end up uploading the sub-window local region directly, without applying the offset. This problem was revealed when 79bf1b7e348d started being smarter about what regions we flush and to what windows when we have sub windows. Fixes: QTBUG-81723 Change-Id: I1c9c8bc53c088cdc1ae8b892e17930f4a468ccad Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit 81e09ae404b632a92e1e4c27f5875bdf027c5401) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f0cf48d81e
commit
224f91fb29
@ -709,9 +709,10 @@ void QXcbBackingStoreImage::put(xcb_drawable_t dst, const QRegion ®ion, const
|
||||
Q_ASSERT(!m_clientSideScroll);
|
||||
|
||||
ensureGC(dst);
|
||||
setClip(region);
|
||||
|
||||
if (hasShm()) {
|
||||
setClip(region); // Clip in window local coordinates
|
||||
|
||||
// Copy scrolled area on server-side from pixmap to window
|
||||
const QRegion scrolledRegion = m_scrolledRegion.translated(-offset);
|
||||
for (const QRect &rect : scrolledRegion) {
|
||||
@ -732,7 +733,15 @@ void QXcbBackingStoreImage::put(xcb_drawable_t dst, const QRegion ®ion, const
|
||||
const QRect bounds = region.boundingRect();
|
||||
const QPoint target = bounds.topLeft();
|
||||
const QRect source = bounds.translated(offset);
|
||||
flushPixmap(region);
|
||||
|
||||
// First clip in backingstore-local coordinates, and upload
|
||||
// the changed parts of the backingstore to the server.
|
||||
setClip(source);
|
||||
flushPixmap(source);
|
||||
|
||||
// Then clip in window local coordinates, and copy the updated
|
||||
// parts of the backingstore image server-side to the window.
|
||||
setClip(region);
|
||||
xcb_copy_area(xcb_connection(),
|
||||
m_xcb_pixmap,
|
||||
dst,
|
||||
|
Loading…
x
Reference in New Issue
Block a user