Workaround QTBUG-102430, don't move still maximized window
When dragging a maximized window we show normal, but we can
only start moving it when the window managers acknowledges the new
state. The state in QWidget isn't reliable.
(cherry-picked from commit 6e7268e42a)
This commit is contained in:
@@ -126,7 +126,7 @@ FloatingWindow::FloatingWindow(QRect suggestedGeometry, MainWindow *parent)
|
|||||||
view()->setGeometry(suggestedGeometry);
|
view()->setGeometry(suggestedGeometry);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// For QtQuick we do it a bit later, once we have the QQuickWindow
|
// For QtQuick we do it a bit later, once we have the QQuickWindow
|
||||||
#ifdef KDDW_FRONTEND_QTWIDGETS
|
#ifdef KDDW_FRONTEND_QTWIDGETS
|
||||||
if (Platform::instance()->isQtWidgets()) {
|
if (Platform::instance()->isQtWidgets()) {
|
||||||
view()->createPlatformWindow(); // QWidget::create
|
view()->createPlatformWindow(); // QWidget::create
|
||||||
|
|||||||
@@ -416,6 +416,18 @@ bool StateDragging::handleMouseMove(QPoint globalPos)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
if (fw->lastWindowManagerState() == Qt::WindowMaximized) {
|
||||||
|
// The window was maximized, we dragged it, which triggers a show normal.
|
||||||
|
// But we can only start moving the window *after* the (async) window manager acknowledges.
|
||||||
|
// See QTBUG-102430.
|
||||||
|
// Since #286 was only implemented and needed on Linux, then this counter-part is also ifdefed for Linux,
|
||||||
|
// Probably the ifdef could be removed, but don't want to be testing N platforms, who's undocumented behaviour
|
||||||
|
// can change between releases, so narrow the scope and workaround for linux only.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!q->m_nonClientDrag)
|
if (!q->m_nonClientDrag)
|
||||||
fw->view()->window()->setFramePosition(globalPos - q->m_offset);
|
fw->view()->window()->setFramePosition(globalPos - q->m_offset);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user