Skip to content

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

Merged
Arctis-Fireblight merged 1 commit into
Redot-Engine:masterfrom
GeneralProtectionFault:cursor_icon_fix
Aug 30, 2026
Merged

[Linux] Fix incorrectly mapped move & drag icons#1344
Arctis-Fireblight merged 1 commit into
Redot-Engine:masterfrom
GeneralProtectionFault:cursor_icon_fix

Conversation

@GeneralProtectionFault

@GeneralProtectionFault GeneralProtectionFault commented Aug 8, 2026

Copy link
Copy Markdown
Member

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

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 for grabbing, moving, and scrolling interactions.
    • Updated cursor fallbacks to provide more consistent behavior across supported desktop environments.
    • Ensured drag-and-drop and movement cursors display distinct, appropriate visual states.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f5c194a-2cc7-4a3c-b3df-8cc78d443347

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6b5b8 and 55acd3c.

📒 Files selected for processing (1)
  • platform/linuxbsd/x11/display_server_x11.cpp

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


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 and X11 now use updated drag and move cursor shapes, theme names, and fallbacks.

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

Merge Risk: ⚪ Minimal · up to 55acd

The PR corrects move and pan cursor behavior on Linux without affecting data, permissions, deployment, or runtime dependencies; no actionable merge-blocking risk remains after normal checks and review.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: correcting incorrectly mapped move and drag cursor icons on Linux across X11 and Wayland.
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.
  • Fix all pre-merge checks with AI
✨ 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.

Comment thread platform/linuxbsd/x11/display_server_x11.cpp Outdated
@GeneralProtectionFault GeneralProtectionFault added this to the Redot LTS 26.3 milestone Aug 8, 2026
DaveTheEggman
DaveTheEggman previously approved these changes Aug 25, 2026

@DaveTheEggman DaveTheEggman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@GeneralProtectionFault

Copy link
Copy Markdown
Member Author

@coderabbitai Please confirm if latest push resolves your 2 comments.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="Redot-Engine/redot-engine"
pr="1344"

echo '=== CodeRabbit review comments ==='
gh api "repos/${repo}/pulls/${pr}/comments?per_page=100" \
  --paginate \
  --jq '.[] | select(.user.login == "coderabbitai") | {id, path, line, original_line, body, commit_id}' || true

echo '=== PR files and latest head ==='
gh pr view "$pr" --repo "$repo" --json headRefOid,files \
  --jq '{headRefOid, files: [.files[] | {path, additions, deletions}]}' || true

echo '=== Relevant source outlines ==='
for file in \
  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
do
  if [ -f "$file" ]; then
    echo "--- $file ---"
    ast-grep outline "$file" --items all || true
  fi
done

echo '=== Latest PR diff ==='
git diff --unified=40 "origin/$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"...HEAD -- \
  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 || true

Length of output: 80197


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo_owner="Redot-Engine"
repo_name="redot-engine"
pr_number="1344"

echo '=== Review threads ==='
gh api graphql \
  -F owner="$repo_owner" \
  -F name="$repo_name" \
  -F number="$pr_number" \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          path
          line
          originalLine
          comments(first: 20) {
            nodes {
              author { login }
              body
              url
              createdAt
            }
          }
        }
      }
    }
  }
}' \
  --jq '.data.repository.pullRequest.reviewThreads.nodes[]
    | select([.comments.nodes[].author.login] | any(. == "coderabbitai"))
    | {isResolved, path, line, originalLine, comments}' || true

echo '=== Top-level CodeRabbit comments ==='
gh api "repos/${repo_owner}/${repo_name}/issues/${pr_number}/comments?per_page=100" \
  --paginate \
  --jq '.[] | select(.user.login == "coderabbitai") | {created_at, body, html_url}' || true

Length of output: 8249


@GeneralProtectionFault No. The latest push does not resolve either comment.

  1. CURSOR_CAN_DROP is now selected during panning in both canvas cursor paths. However, the theme-backed mappings still load "dnd-move" with "hand1" fallback:

    • platform/linuxbsd/wayland/wayland_thread.cpp
    • platform/linuxbsd/x11/display_server_x11.cpp

    These mappings must load the closed-hand cursor resource for CURSOR_CAN_DROP.

  2. CURSOR_MOVE in platform/linuxbsd/x11/display_server_x11.cpp still uses "fleur" as both the primary resource and the fallback. If the primary lookup fails, the fallback repeats the same failed lookup.

You are interacting with an AI system.

@GeneralProtectionFault

Copy link
Copy Markdown
Member Author

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain
🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="Redot-Engine/redot-engine"
pr="1344"

echo '=== CodeRabbit review comments ==='
gh api "repos/${repo}/pulls/${pr}/comments?per_page=100" \
  --paginate \
  --jq '.[] | select(.user.login == "coderabbitai") | {id, path, line, original_line, body, commit_id}' || true

echo '=== PR files and latest head ==='
gh pr view "$pr" --repo "$repo" --json headRefOid,files \
  --jq '{headRefOid, files: [.files[] | {path, additions, deletions}]}' || true

echo '=== Relevant source outlines ==='
for file in \
  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
do
  if [ -f "$file" ]; then
    echo "--- $file ---"
    ast-grep outline "$file" --items all || true
  fi
done

echo '=== Latest PR diff ==='
git diff --unified=40 "origin/$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"...HEAD -- \
  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 || true

Length of output: 80197

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo_owner="Redot-Engine"
repo_name="redot-engine"
pr_number="1344"

echo '=== Review threads ==='
gh api graphql \
  -F owner="$repo_owner" \
  -F name="$repo_name" \
  -F number="$pr_number" \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          path
          line
          originalLine
          comments(first: 20) {
            nodes {
              author { login }
              body
              url
              createdAt
            }
          }
        }
      }
    }
  }
}' \
  --jq '.data.repository.pullRequest.reviewThreads.nodes[]
    | select([.comments.nodes[].author.login] | any(. == "coderabbitai"))
    | {isResolved, path, line, originalLine, comments}' || true

echo '=== Top-level CodeRabbit comments ==='
gh api "repos/${repo_owner}/${repo_name}/issues/${pr_number}/comments?per_page=100" \
  --paginate \
  --jq '.[] | select(.user.login == "coderabbitai") | {created_at, body, html_url}' || true

Length of output: 8249

@GeneralProtectionFault No. The latest push does not resolve either comment.

  1. CURSOR_CAN_DROP is now selected during panning in both canvas cursor paths. However, the theme-backed mappings still load "dnd-move" with "hand1" fallback:

    • platform/linuxbsd/wayland/wayland_thread.cpp
    • platform/linuxbsd/x11/display_server_x11.cpp

    These mappings must load the closed-hand cursor resource for CURSOR_CAN_DROP.

  2. CURSOR_MOVE in platform/linuxbsd/x11/display_server_x11.cpp still uses "fleur" as both the primary resource and the fallback. If the primary lookup fails, the fallback repeats the same failed lookup.

You are interacting with an AI system.

Woulda helped if I had staged my changes first 🥇
Disregard...

@GeneralProtectionFault

Copy link
Copy Markdown
Member Author

Ok long as the tests complete ok, this should be good now.
Basically, I set the correct icon, but didn't swap it for the fallback icon.
My understanding is that the reason for this fallback is because of a legacy & modern way to name these icons.
I tested on my machine with Breeze & Oxygen icon sets, which I had installed, both correct.
I believe this is the way it should be, but it's apparently the theme more than the desktop environment that determines what values/images are used, so testing with different themes is probably the ideal way to validate this even further if desired.

@Arctis-Fireblight Arctis-Fireblight left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Arctis-Fireblight
Arctis-Fireblight merged commit 996daf4 into Redot-Engine:master Aug 30, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from Open to Done in Engine Overview Aug 30, 2026
@GeneralProtectionFault
GeneralProtectionFault deleted the cursor_icon_fix branch September 1, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants