[Linux] Fix incorrectly mapped move & drag icons - #1344
[Linux] Fix incorrectly mapped move & drag icons#1344GeneralProtectionFault wants to merge 1 commit into
Conversation
WalkthroughThe editor uses ChangesCursor shape updates
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
d891eef to
3d54abf
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
editor/scene/canvas_item_editor_plugin.cppplatform/linuxbsd/wayland/wayland_thread.cppplatform/linuxbsd/wayland/wayland_thread.hplatform/linuxbsd/x11/display_server_x11.cpp
| "grab", | ||
| "dnd-move", | ||
| "crossed_circle", | ||
| "v_double_arrow", | ||
| "h_double_arrow", | ||
| "size_bdiag", | ||
| "size_fdiag", | ||
| "move", | ||
| "fleur", |
There was a problem hiding this comment.
🎯 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.cppRepository: 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/**' || trueRepository: 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"; |
There was a problem hiding this comment.
🎯 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 -80Repository: 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.
Currently, both X11 & Wayland have incorrect icons for move & pan (2D view).

Not the icons themselves, but the mouse cursor displayed when clicking on/using them.
Wayland:
X11:
This PR fixes both.
Summary by CodeRabbit