From f1aa03b7790175b5a936ee337afb71bbeff41ef5 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 29 Aug 2022 11:13:29 +0200 Subject: [PATCH] WindowServer: Place drag and drop overlay at the cursor position ... instead of in the center of the cursor bitmap. It doesn't make much of a difference, as the default cursor hotspot is center. But since now we switch between a normal Drag cursor and DragCopy one that has set hotspot, this caused the overlay to shake. --- Userland/Services/WindowServer/Overlays.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Services/WindowServer/Overlays.cpp b/Userland/Services/WindowServer/Overlays.cpp index 1a2ac6291d..87320cbb26 100644 --- a/Userland/Services/WindowServer/Overlays.cpp +++ b/Userland/Services/WindowServer/Overlays.cpp @@ -292,7 +292,7 @@ void DndOverlay::update_rect() auto& font = this->font(); int width = font.width(m_text) + bitmap_width; int height = max((int)font.glyph_height(), bitmap_height); - auto location = Compositor::the().current_cursor_rect().center().translated(8, 8); + auto location = ScreenInput::the().cursor_location().translated(8, 8); set_rect(Gfx::IntRect(location, { width, height }).inflated(16, 8)); }