From bcb7893156d87397aac214ccf1f26e34658b66ca Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 16 May 2019 20:29:42 +0200 Subject: [PATCH] WindowServer: Don't treat bottom titlebar edge as part of the border. We were allowing initiation of resize from the bottom titlebar edge since everything inside the window frame that's not either inside the title bar, or inside the window content, is considered the border. --- Servers/WindowServer/WSWindowFrame.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Servers/WindowServer/WSWindowFrame.cpp b/Servers/WindowServer/WSWindowFrame.cpp index ba42e4e67e..14e58319d9 100644 --- a/Servers/WindowServer/WSWindowFrame.cpp +++ b/Servers/WindowServer/WSWindowFrame.cpp @@ -257,7 +257,14 @@ void WSWindowFrame::on_mouse_event(const WSMouseEvent& event) auto& wm = WSWindowManager::the(); if (m_window.type() != WSWindowType::Normal) return; - if (title_bar_rect().contains(event.position())) { + + // This is slightly hackish, but expand the title bar rect by one pixel downwards, + // so that mouse events between the title bar and window contents don't act like + // mouse events on the border. + auto adjusted_title_bar_rect = title_bar_rect(); + adjusted_title_bar_rect.set_height(adjusted_title_bar_rect.height() + 1); + + if (adjusted_title_bar_rect.contains(event.position())) { wm.clear_resize_candidate(); if (event.type() == WSEvent::MouseDown)