From e8d77c010107c3a5c378f703b17691c77d29e2d6 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 9 Jun 2016 11:59:06 +0200 Subject: [PATCH] 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 --- .../wayland/plugins/decorations/bradient/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp b/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp index ea298699385..3dd5c8b699a 100644 --- a/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp +++ b/src/plugins/platforms/wayland/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);