windows: Port system move support
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "Window.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
Window::~Window() = default;
|
||||
@@ -34,3 +36,9 @@ int Window::maxHeight() const
|
||||
{
|
||||
return maxSize().height();
|
||||
}
|
||||
|
||||
void Window::startSystemMove()
|
||||
{
|
||||
qFatal("Not needed in this platform");
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
virtual QSize minSize() const = 0;
|
||||
virtual QSize maxSize() const = 0;
|
||||
virtual QPoint fromNativePixels(QPoint) const = 0;
|
||||
virtual void startSystemMove();
|
||||
|
||||
int minWidth() const;
|
||||
int minHeight() const;
|
||||
|
||||
@@ -292,7 +292,7 @@ void StateDragging::onEntry()
|
||||
const bool needsUndocking = !q->m_draggable->isWindow();
|
||||
q->m_windowBeingDragged = q->m_draggable->makeWindow();
|
||||
if (q->m_windowBeingDragged) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) && defined(Q_OS_WIN_TODO)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) && defined(Q_OS_WIN)
|
||||
if (!q->m_nonClientDrag && KDDockWidgets::usesNativeDraggingAndResizing()) {
|
||||
// Started as a client move, as the dock widget was docked,
|
||||
// but now that we're dragging it as a floating window, switch to native drag, so we can still get aero-snap
|
||||
@@ -301,7 +301,7 @@ void StateDragging::onEntry()
|
||||
q->m_windowBeingDragged.reset();
|
||||
q->m_windowBeingDragged = fw->makeWindow();
|
||||
|
||||
QWindow *window = fw->window();
|
||||
Window::Ptr window = fw->view()->window();
|
||||
|
||||
if (needsUndocking) {
|
||||
// Position the window before the drag start, otherwise if you move mouse too fast there will be an offset
|
||||
@@ -901,7 +901,7 @@ ViewWrapper::Ptr DragController::qtTopLevelUnderCursor() const
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#endif // Q_OS_WIN_TODO
|
||||
#endif // Q_OS_WIN
|
||||
} else if (linksToXLib() && isXCB()) {
|
||||
bool ok = false;
|
||||
const Window::List orderedWindows = KDDockWidgets::orderedWindows(ok);
|
||||
|
||||
@@ -145,3 +145,8 @@ QPoint Window_qt::fromNativePixels(QPoint nativePos) const
|
||||
{
|
||||
return QHighDpi::fromNativePixels(nativePos, m_window.data());
|
||||
}
|
||||
|
||||
void Window_qt::startSystemMove()
|
||||
{
|
||||
m_window->startSystemMove();
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
QSize minSize() const override;
|
||||
QSize maxSize() const override;
|
||||
QPoint fromNativePixels(QPoint) const override;
|
||||
void startSystemMove() override;
|
||||
|
||||
protected:
|
||||
QPointer<QWindow> m_window;
|
||||
|
||||
Reference in New Issue
Block a user