summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-06-09 11:59:06 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-06-20 10:29:27 +0000
commitb1e61e7e244faf13b6a750809adcccb526e68033 (patch)
tree03fa966bb5a2582d5c060acfd0687543e45d5e63
parent3468177305c158f82fa32c2c6047a97e63cfe104 (diff)
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>
-rw-r--r--src/plugins/decorations/bradient/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp
index ea2986993..3dd5c8b69 100644
--- a/src/plugins/decorations/bradient/main.cpp
+++ b/src/plugins/decorations/bradient/main.cpp
@@ -359,11 +359,11 @@ bool QWaylandBradientDecoration::handleMouse(QWaylandInputDevice *inputDevice, c
window()->setWindowState(Qt::WindowMinimized);
} else if (local.y() <= margins().top()) {
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);
} else if (local.x() <= margins().left()) {
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);
} else {
waylandWindow()->restoreMouseCursor(inputDevice);
@@ -405,7 +405,7 @@ void QWaylandBradientDecoration::processMouseTop(QWaylandInputDevice *inputDevic
//top left bit
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor);
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
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor);
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_RIGHT,b);
@@ -428,7 +428,7 @@ void QWaylandBradientDecoration::processMouseBottom(QWaylandInputDevice *inputDe
//bottom left bit
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor);
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
waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor);
startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT,b);