Skip to content

[Linux] Fix incorrectly mapped move & drag icons - #1344

Open
GeneralProtectionFault wants to merge 1 commit into
Redot-Engine:masterfrom
GeneralProtectionFault:cursor_icon_fix
Open

[Linux] Fix incorrectly mapped move & drag icons#1344
GeneralProtectionFault wants to merge 1 commit into
Redot-Engine:masterfrom
GeneralProtectionFault:cursor_icon_fix

Conversation

@GeneralProtectionFault

@GeneralProtectionFault GeneralProtectionFault commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Currently, both X11 & Wayland have incorrect icons for move & pan (2D view).
image

Not the icons themselves, but the mouse cursor displayed when clicking on/using them.

Wayland:

  • Move icon - shows closed hand
  • Pan icon - shows correct open hand icon, but does not close when clicking/dragging

X11:

  • Move icon - shows closed hand
  • Pan icon - shows move icon

This PR fixes both.

Summary by CodeRabbit

  • Bug Fixes
    • Improved cursor feedback while panning the 2D canvas, clearly indicating when dropping is possible.
    • Corrected cursor appearances on Linux using Wayland and X11, including grab, move, and scrolling interactions.
    • Updated cursor fallbacks to provide more consistent behavior across supported desktop environments.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The editor uses CURSOR_CAN_DROP while panning. Wayland and X11 cursor mappings now use updated grab and move cursor shapes, theme names, and fallbacks.

Changes

Cursor shape updates

Layer / File(s) Summary
Editor panning cursor
editor/scene/canvas_item_editor_plugin.cpp
Both panning cursor paths now return CURSOR_CAN_DROP instead of CURSOR_DRAG.
Linux cursor mappings
platform/linuxbsd/wayland/wayland_thread.cpp, platform/linuxbsd/wayland/wayland_thread.h, platform/linuxbsd/x11/display_server_x11.cpp
Wayland uses the grab theme name and ALL_SCROLL shape. X11 uses grab for dragging and fleur for moving, including the move-cursor fallback.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the Linux cursor mapping fixes in the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@platform/linuxbsd/wayland/wayland_thread.cpp`:
- Around line 348-355: Update the CURSOR_CAN_DROP resource mapping to use the
closed-hand cursor for panning in platform/linuxbsd/wayland/wayland_thread.cpp
lines 348-355 and platform/linuxbsd/x11/display_server_x11.cpp lines 7310-7311;
retain an X11-compatible fallback where necessary.

In `@platform/linuxbsd/x11/display_server_x11.cpp`:
- Line 7362: Update the CURSOR_MOVE fallback assignment in the X11
cursor-loading logic so it does not reuse the primary "fleur" cursor alias; use
a different valid cursor alias or preserve the final image fallback path to
allow recovery when the primary lookup fails.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7697d564-4fb3-43e0-bf11-278a3c507c62

📥 Commits

Reviewing files that changed from the base of the PR and between c614335 and 3d54abf.

📒 Files selected for processing (4)
  • editor/scene/canvas_item_editor_plugin.cpp
  • platform/linuxbsd/wayland/wayland_thread.cpp
  • platform/linuxbsd/wayland/wayland_thread.h
  • platform/linuxbsd/x11/display_server_x11.cpp

Comment on lines +348 to +355
"grab",
"dnd-move",
"crossed_circle",
"v_double_arrow",
"h_double_arrow",
"size_bdiag",
"size_fdiag",
"move",
"fleur",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Locate files"
fd -a 'wayland_thread.cpp|display_server_x11.cpp|cursor.*|mouse.*' . | sed 's#^\./##' | head -100

echo
echo "Find CURSOR_CAN_DROP usages"
rg -n "CURSOR_CAN_DROP|CURSOR_GRABBING|GRABBING|grabbing|dnd-move|hand1|m_fleur|fleur" platform .github 2>/dev/null || true

echo
echo "Inspect wayland mapping area"
sed -n '300,380p' platform/linuxbsd/wayland/wayland_thread.cpp

echo
echo "Inspect X11 mapping area"
sed -n '7260,7335p' platform/linuxbsd/x11/display_server_x11.cpp

Repository: Redot-Engine/redot-engine

Length of output: 6963


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Search canvas viewport panning usages"
rg -n "pan_|PAN|CURSOR_CAN_DROP|CURSOR_DRAG|CursorDrag|CURSOR_MAX" scene editor platform --glob '!thirdparty/**' --glob '!doc/**' || true

echo
echo "Inspect cursor usage sites"
sed -n '340,375p' platform/linuxbsd/wayland/wayland_thread.h
sed -n '330,360p' platform/linuxbsd/wayland/wayland_thread.cpp
sed -n '7330,7350p' platform/linuxbsd/x11/display_server_x11.cpp

echo
echo "Search cursor_can_drop identifier"
rg -n "cursor_can_drop|_can_drop|SetCursorCanDrop|set_cursor_can_drop" platform editor scene --glob '!thirdparty/**' --glob '!doc/**' || true

Repository: Redot-Engine/redot-engine

Length of output: 50382


Align the CURSOR_CAN_DROP cursor resource with panning.

CURSOR_CAN_DROP is the panning cursor shape on Linux, but the theme-backed cursor load paths use drag-and-drop move cursors. In both platform/linuxbsd/wayland/wayland_thread.cpp#L349 and platform/linuxbsd/x11/display_server_x11.cpp#L7311, use the closed-hand cursor resource for CURSOR_CAN_DROP; keep the fallback compatible for X11 as needed.

📍 Affects 2 files
  • platform/linuxbsd/wayland/wayland_thread.cpp#L348-L355 (this comment)
  • platform/linuxbsd/x11/display_server_x11.cpp#L7310-L7311
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@platform/linuxbsd/wayland/wayland_thread.cpp` around lines 348 - 355, Update
the CURSOR_CAN_DROP resource mapping to use the closed-hand cursor for panning
in platform/linuxbsd/wayland/wayland_thread.cpp lines 348-355 and
platform/linuxbsd/x11/display_server_x11.cpp lines 7310-7311; retain an
X11-compatible fallback where necessary.

break;
case CURSOR_MOVE:
cursor_img[i] = cursor_img[CURSOR_DRAG];
fallback = "fleur";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the relevant X11 cursor fallback logic.
file="platform/linuxbsd/x11/display_server_x11.cpp"
if [ ! -f "$file" ]; then
  echo "ERROR: $file not found"
  git ls-files | rg 'platform/.*/x11/display_server_x11\.cpp|display_server_x11\.cpp' || true
  exit 0
fi

echo "== file size =="
wc -l "$file"

echo "== context 7290-7385 =="
sed -n '7290,7385p' "$file" | nl -ba -v7290

echo "== cursor move occurrences =="
rg -n 'CURSOR_MOVE|fallback = "fleur"|_load.*cursor|cursor_theme|load.*Image' "$file"

Repository: Redot-Engine/redot-engine

Length of output: 294


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="platform/linuxbsd/x11/display_server_x11.cpp"

echo "== context 7290-7385 =="
sed -n '7290,7385p' "$file"

echo "== cursor move occurrences and relevant nearby patterns =="
rg -n 'CURSOR_MOVE|fallback = "fleur"|fallback =|XCursor|Image|Cursor|load|theme|_load' "$file" | rg -n 'CURSOR_MOVE|fallback = "fleur"|fallback =|XCursor|Image|Cursor|load|theme|_load' | head -80

Repository: Redot-Engine/redot-engine

Length of output: 7837


Use a distinct fallback for CURSOR_MOVE.

"fleur" is loaded as the primary cursor at index CURSOR_MOVE. If that lookup fails, the fallback also uses "fleur", so XcursorLibraryLoadImage() repeats the same lookup and cannot recover. Use a different valid cursor alias or keep a final image fallback path here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@platform/linuxbsd/x11/display_server_x11.cpp` at line 7362, Update the
CURSOR_MOVE fallback assignment in the X11 cursor-loading logic so it does not
reuse the primary "fleur" cursor alias; use a different valid cursor alias or
preserve the final image fallback path to allow recovery when the primary lookup
fails.

@GeneralProtectionFault GeneralProtectionFault added this to the Redot LTS 26.3 milestone Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Open

Development

Successfully merging this pull request may close these issues.

1 participant