Skip to content

feat(input): add an option to use system cursors - #26

Merged
CoderDayton merged 2 commits into
mainfrom
feat/system-cursors
Oct 17, 2026
Merged

CoderDayton merged 2 commits into
mainfrom
feat/system-cursors

Conversation

@dim-ghub

Copy link
Copy Markdown
Collaborator

Adds input.system_cursor (also in the settings window) to show the desktop's arrow, hand and text cursors instead of Roblox's. Custom game cursors and the shift lock cursor are unchanged. On Wayland, the cursor also stays visible during right-drag camera turns.

input.system_cursor swaps the arrow, hand and text cursors Roblox draws
for the desktop's own. Custom game cursors and the shift lock cursor are
still drawn by Roblox. The cursor also stays visible at the press point
during a right-drag camera turn on Wayland.

@CoderDayton CoderDayton left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Tested on GNOME Wayland. With input.system_cursor off, right-drag now shows the desktop cursor on top of Roblox's. Roblox keeps drawing its own cursor during the drag here, so the "keep a cursor at the press point" change adds a second one. With the option on it works: one desktop cursor during the drag.

The drag cursor should only show when the desktop cursor was already showing before the drag. With the option off, that's never the case, so it stays like before.

Test first. Flip CameraDragOverRobloxCursorShowsTheArrow in tests/window_pointer_capture_owner_test.cc:

-TEST(WindowPointerCaptureOwnerTest, CameraDragOverRobloxCursorShowsTheArrow) {
+TEST(WindowPointerCaptureOwnerTest, CameraDragOverRobloxCursorKeepsItHidden) {
 ...
   EXPECT_TRUE(owner.OnRightButton(true, false));
   EXPECT_TRUE(owner.captured());
-  EXPECT_EQ(owner.cursor(), CursorShape::kArrow);
+  EXPECT_EQ(owner.cursor(), CursorShape::kHidden);
 }

It fails on the PR as is. Then in WindowPointerCaptureOwner::Pump (src/window/window_pointer_capture_owner.cc):

     if (!captured_) {
-      capture_cursor_ =
-          cursor_ != CursorShape::kHidden ? cursor_ : CursorShape::kArrow;
+      capture_cursor_ = cursor_;
     }

All 26 tests in window_pointer_capture_owner_test pass with it.

Two follow-ups from the same change:

  • The comment above that block ("Roblox hides its cursor during an RMB camera drag") isn't true on every desktop. Roblox keeps drawing its cursor on GNOME.
  • The CHANGELOG bullet "On Wayland, the cursor now stays on screen at the press point..." now only applies with input.system_cursor on, so it belongs in that entry instead of standing alone.

If you see Roblox's cursor disappear during the drag with the option off on your setup, can you run this and right-drag a few times:

MOCKTAIL_SYSTEM_CURSOR=on MOCKTAIL_CURSOR_TRACE=1 mocktail

If it prints Roblox draws no cursor while you drag, Roblox is hiding it on your end, and that's worth fixing on its own.

@dim-ghub

Copy link
Copy Markdown
Collaborator Author

Fixed. The drag cursor now only shows if the desktop cursor was already showing. Also covered a right click that refocuses the window, updated the comment and moved the changelog line.

@CoderDayton CoderDayton left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Tested on GNOME Wayland with system cursors on and off. Right-drag camera turns no longer leave a cursor on screen, clicking back into the window after alt-tab works, and menu hovers show the desktop shapes. The full test suite passes (1706 tests, 0 failed).

@CoderDayton
CoderDayton merged commit 9665aac into main Oct 17, 2026
6 checks passed
@CoderDayton
CoderDayton deleted the feat/system-cursors branch October 17, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants