1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

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.
This commit is contained in:
Andreas Kling 2019-05-16 20:29:42 +02:00
parent c597c2332b
commit bcb7893156

View file

@ -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)