Fix dragging inside a modal window when a QShapedPixmapWindow is used

A regression was introduced with a3d59c7c7f675b0a4e128efeb781aa1c2f7db4c0
which caused dragging to fail within a modal dialog on the XCB platform.
By adding an exception for the QShapedPixmapWindow, which is the window
used for the drag, we can allow that to continue to work whilst blocking
to the other newly created windows.

Task-number: QTBUG-63846
Change-Id: I7c7f365f30fcf5f04f50dc1a7fff7a09e6e5ed6c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
Andy Shaw 2017-10-27 08:36:25 +02:00
parent b409cfa094
commit acdb334032

View File

@ -54,6 +54,7 @@
# include "qaccessible.h"
#endif
#include "qhighdpiscaling_p.h"
#include "qshapedpixmapdndwindow_p.h"
#include <private/qevent_p.h>
@ -576,7 +577,9 @@ void QWindow::setVisible(bool visible)
QGuiApplicationPrivate::showModalWindow(this);
else
QGuiApplicationPrivate::hideModalWindow(this);
} else if (visible && QGuiApplication::modalWindow()) {
// QShapedPixmapWindow is used on some platforms for showing a drag pixmap, so don't block
// input to this window as it is performing a drag - QTBUG-63846
} else if (visible && QGuiApplication::modalWindow() && !qobject_cast<QShapedPixmapWindow *>(this)) {
QGuiApplicationPrivate::updateBlockedStatus(this);
}