Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions editor/scene/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ void CanvasItemEditor::_update_cursor() {
break;
}
if (pan_pressed) {
c = CURSOR_DRAG;
c = CURSOR_CAN_DROP;
}
set_default_cursor_shape(c);
}
Expand Down Expand Up @@ -2966,7 +2966,7 @@ Control::CursorShape CanvasItemEditor::get_cursor_shape(const Point2 &p_pos) con
}

if (pan_pressed) {
c = CURSOR_DRAG;
c = CURSOR_CAN_DROP;
}
return c;
}
Expand Down
4 changes: 2 additions & 2 deletions platform/linuxbsd/wayland/wayland_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,14 @@ bool WaylandThread::_load_cursor_theme(int p_cursor_size) {
"cross",
"watch",
"left_ptr_watch",
"fleur",
"grab",
"dnd-move",
"crossed_circle",
"v_double_arrow",
"h_double_arrow",
"size_bdiag",
"size_fdiag",
"move",
"fleur",
Comment on lines +348 to +355

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.

"row_resize",
"col_resize",
"question_arrow"
Expand Down
2 changes: 1 addition & 1 deletion platform/linuxbsd/wayland/wayland_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ class WaylandThread {
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE, ///< CURSOR_HSIZE
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE, ///< CURSOR_BDIAGSIZE
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE, ///< CURSOR_FDIAGSIZE
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_MOVE, ///< CURSOR_MOVE
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL, ///< CURSOR_MOVE
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE, ///< CURSOR_VSPLIT
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE, ///< CURSOR_HSPLIT
wp_cursor_shape_device_v1_shape::WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP, ///< CURSOR_HELP
Expand Down
36 changes: 18 additions & 18 deletions platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7301,23 +7301,23 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode

for (int i = 0; i < CURSOR_MAX; i++) {
static const char *cursor_file[] = {
"left_ptr",
"xterm",
"hand2",
"cross",
"watch",
"left_ptr_watch",
"fleur",
"dnd-move",
"crossed_circle",
"v_double_arrow",
"h_double_arrow",
"size_bdiag",
"size_fdiag",
"move",
"row_resize",
"col_resize",
"question_arrow"
"left_ptr", // CURSOR_ARROW
"xterm", // CURSOR_IBEAM
"hand2", // CURSOR_POINTING_HAND
"cross", // CURSOR_CROSS
"watch", // CURSOR_WAIT
"left_ptr_watch", // CURSOR_BUSY
"grab", // CURSOR_DRAG
"dnd-move", // CURSOR_CAN_DROP
"crossed_circle", // CURSOR_FORBIDDEN
"v_double_arrow", // CURSOR_VSIZE
"h_double_arrow", // CURSOR_HSIZE
"size_bdiag", // CURSOR_BDIAGSIZE
"size_fdiag", // CURSOR_FDIAGSIZE
"fleur", // CURSOR_MOVE
"row_resize", // CURSOR_VSPLIT
"col_resize", // CURSOR_HSPLIT
"question_arrow" // CURSOR_HELP
};

cursor_img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size);
Expand Down Expand Up @@ -7359,7 +7359,7 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
fallback = "bd_double_arrow";
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.

break;
case CURSOR_VSPLIT:
fallback = "sb_v_double_arrow";
Expand Down
Loading