فهرست منبع

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.
Andreas Kling 6 سال پیش
والد
کامیت
bcb7893156
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      Servers/WindowServer/WSWindowFrame.cpp

+ 8 - 1
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)