summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-01-23 02:45:03 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-23 08:34:17 +0100
commite93701287031b5de8ad1112196f313fdf3414464 (patch)
tree4e3d4abdc07985066f6773f4bd23a12462d20d20 /Userland/Services
parenta671a5ba7e6bde918304e77cd9692827cb0072ff (diff)
downloadserenity-e93701287031b5de8ad1112196f313fdf3414464.zip
WindowServer: Make dragging maximized windows up no-op
That's what that piece of logic is probably supposed to be doing. Let's help it acheive that purpose! Apparently the top of the desktop (i.e. the menubar) was forgotten, so consider it part of the deadzone.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WindowServer/WindowManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp
index ac66601bf1..f4ce58524c 100644
--- a/Userland/Services/WindowServer/WindowManager.cpp
+++ b/Userland/Services/WindowServer/WindowManager.cpp
@@ -522,13 +522,14 @@ bool WindowManager::process_ongoing_window_move(MouseEvent& event, Window*& hove
const int tiling_deadzone = 10;
const int secondary_deadzone = 2;
+ auto desktop = desktop_rect();
if (m_move_window->is_maximized()) {
auto pixels_moved_from_start = event.position().pixels_moved(m_move_origin);
if (pixels_moved_from_start > 5) {
// dbgln("[WM] de-maximizing window");
m_move_origin = event.position();
- if (m_move_origin.y() <= secondary_deadzone)
+ if (m_move_origin.y() <= secondary_deadzone + desktop.top())
return true;
m_move_window->set_maximized(false, event.position());
m_move_window_origin = m_move_window->position();
@@ -536,7 +537,6 @@ bool WindowManager::process_ongoing_window_move(MouseEvent& event, Window*& hove
} else {
bool is_resizable = m_move_window->is_resizable();
auto pixels_moved_from_start = event.position().pixels_moved(m_move_origin);
- auto desktop = desktop_rect();
if (is_resizable && event.x() <= tiling_deadzone) {
if (event.y() <= tiling_deadzone + desktop.top())