diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index f97e7ac345..1ffdf04091 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -176,7 +176,7 @@ void Window::set_rect_without_repaint(const Gfx::IntRect& rect) m_frame.notify_window_rect_changed(old_rect, rect); // recomputes occlusions } -void Window::normalize_rect() +void Window::normalize_rect(bool force_titlebar_visible) { Gfx::IntRect arena = WindowManager::the().arena_rect_for_type(type()); auto min_size = 1; @@ -201,7 +201,7 @@ void Window::normalize_rect() // Make sure that at least half of the titlebar is visible. auto min_frame_y = arena.top() - (y() - old_frame_rect.y()) / 2; - if (new_frame_rect.y() < min_frame_y) { + if (force_titlebar_visible && new_frame_rect.y() < min_frame_y) { new_frame_rect.set_y(min_frame_y); } diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h index 0f2df1847d..009ca30770 100644 --- a/Userland/Services/WindowServer/Window.h +++ b/Userland/Services/WindowServer/Window.h @@ -159,7 +159,7 @@ public: void set_rect(const Gfx::IntRect&); void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); } void set_rect_without_repaint(const Gfx::IntRect&); - void normalize_rect(); + void normalize_rect(bool force_titlebar_visible = true); void set_taskbar_rect(const Gfx::IntRect&); const Gfx::IntRect& taskbar_rect() const { return m_taskbar_rect; } diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 52cb1c24f6..c9846a225d 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -554,8 +554,10 @@ bool WindowManager::process_ongoing_window_move(MouseEvent& event, Window*& hove } else if (m_move_window->tiled() == WindowTileType::None) { Gfx::IntPoint pos = m_move_window_origin.translated(event.position() - m_move_origin); m_move_window->set_position_without_repaint(pos); - // "Bounce back" the window it it would end up too far outside the screen: - m_move_window->normalize_rect(); + // "Bounce back" the window if it would end up too far outside the screen. + // If the user has let go of Mod_Logo, maybe they didn't intentionally press it to begin with. Therefore, refuse to go into a state where knowledge about super-drags is necessary. + bool force_titlebar_visible = !(m_keyboard_modifiers & Mod_Logo); + m_move_window->normalize_rect(force_titlebar_visible); } else if (pixels_moved_from_start > 5) { m_move_window->set_untiled(event.position()); m_move_origin = event.position();