mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
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.
This commit is contained in:
parent
a671a5ba7e
commit
e937012870
1 changed files with 2 additions and 2 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue