diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp index 9cb37b02c5..7257ecdd32 100644 --- a/Libraries/LibGUI/Window.cpp +++ b/Libraries/LibGUI/Window.cpp @@ -89,6 +89,7 @@ void Window::show() { if (is_visible()) return; + m_override_cursor = StandardCursor::None; auto response = WindowServerConnection::the().send_sync( m_rect_when_windowless, m_has_alpha_channel, @@ -123,6 +124,7 @@ void Window::hide() m_pending_paint_event_rects.clear(); m_back_bitmap = nullptr; m_front_bitmap = nullptr; + m_override_cursor = StandardCursor::None; bool app_has_visible_windows = false; for (auto& window : *all_windows) { @@ -183,7 +185,10 @@ void Window::set_override_cursor(StandardCursor cursor) { if (!is_visible()) return; + if (m_override_cursor == cursor) + return; WindowServerConnection::the().send_sync(m_window_id, (u32)cursor); + m_override_cursor = cursor; } void Window::event(Core::Event& event) diff --git a/Libraries/LibGUI/Window.h b/Libraries/LibGUI/Window.h index 10527fed6d..f8fe54652d 100644 --- a/Libraries/LibGUI/Window.h +++ b/Libraries/LibGUI/Window.h @@ -212,6 +212,7 @@ private: Gfx::Size m_base_size; Color m_background_color { Color::WarmGray }; WindowType m_window_type { WindowType::Normal }; + StandardCursor m_override_cursor { StandardCursor::None }; bool m_is_active { false }; bool m_has_alpha_channel { false }; bool m_double_buffering_enabled { true };