Only resize when the cursor is actually on the window frame
The previous code seems to have been written under the impression that QWindow::width() included frame margins, causing the resizing areas of the window decoration to be too large. Change-Id: Ia13f12afd88a4017d01853798226455b84290d01 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
This commit is contained in:
parent
ad7245b942
commit
e8d77c0101
@ -359,11 +359,11 @@ bool QWaylandBradientDecoration::handleMouse(QWaylandInputDevice *inputDevice, c
|
|||||||
window()->setWindowState(Qt::WindowMinimized);
|
window()->setWindowState(Qt::WindowMinimized);
|
||||||
} else if (local.y() <= margins().top()) {
|
} else if (local.y() <= margins().top()) {
|
||||||
processMouseTop(inputDevice,local,b,mods);
|
processMouseTop(inputDevice,local,b,mods);
|
||||||
} else if (local.y() > window()->height() - margins().bottom() + margins().top()) {
|
} else if (local.y() > window()->height() + margins().top()) {
|
||||||
processMouseBottom(inputDevice,local,b,mods);
|
processMouseBottom(inputDevice,local,b,mods);
|
||||||
} else if (local.x() <= margins().left()) {
|
} else if (local.x() <= margins().left()) {
|
||||||
processMouseLeft(inputDevice,local,b,mods);
|
processMouseLeft(inputDevice,local,b,mods);
|
||||||
} else if (local.x() > window()->width() - margins().right() + margins().left()) {
|
} else if (local.x() > window()->width() + margins().left()) {
|
||||||
processMouseRight(inputDevice,local,b,mods);
|
processMouseRight(inputDevice,local,b,mods);
|
||||||
} else {
|
} else {
|
||||||
waylandWindow()->restoreMouseCursor(inputDevice);
|
waylandWindow()->restoreMouseCursor(inputDevice);
|
||||||
@ -405,7 +405,7 @@ void QWaylandBradientDecoration::processMouseTop(QWaylandInputDevice *inputDevic
|
|||||||
//top left bit
|
//top left bit
|
||||||
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor);
|
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor);
|
||||||
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_LEFT,b);
|
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_LEFT,b);
|
||||||
} else if (local.x() > window()->width() - margins().right()) {
|
} else if (local.x() > window()->width() + margins().left()) {
|
||||||
//top right bit
|
//top right bit
|
||||||
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor);
|
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor);
|
||||||
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_RIGHT,b);
|
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_RIGHT,b);
|
||||||
@ -428,7 +428,7 @@ void QWaylandBradientDecoration::processMouseBottom(QWaylandInputDevice *inputDe
|
|||||||
//bottom left bit
|
//bottom left bit
|
||||||
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor);
|
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor);
|
||||||
startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT,b);
|
startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT,b);
|
||||||
} else if (local.x() > window()->width() - margins().right()) {
|
} else if (local.x() > window()->width() + margins().left()) {
|
||||||
//bottom right bit
|
//bottom right bit
|
||||||
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor);
|
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor);
|
||||||
startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT,b);
|
startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT,b);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user