Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Closes #4522

What's new?

Mir cursor naming mixed CSS3 and xcursor conventions inconsistently. The codebase now uses CSS3 cursor names throughout while maintaining xcursor theme compatibility.

Added CSS3 cursor constants:

  • mir_diagonal_resize_top_to_left_cursor_name = "nw-resize"
  • mir_diagonal_resize_bottom_to_left_cursor_name = "sw-resize"

Eliminated hardcoded xcursor names:

// Before
case mir_resize_edge_southwest:
    cursor_name = "bottom_left_corner";  // xcursor name
    break;

// After
case mir_resize_edge_southwest:
    cursor_name = mir_diagonal_resize_bottom_to_left_cursor_name;  // CSS3 name
    break;

Compatibility layer:

  • Extended xcursor_name_for_mir_cursor() to map CSS3 → xcursor theme names
  • Added CSS3 aliases to builtin cursor theme for fallback scenarios

How to test

Run miral-app with or without --cursor-theme:

  • Resize window corners to verify all 8 directional cursors appear correctly
  • Test works with both XCursorLoader (themed) and BuiltinCursorImages (fallback)

Checklist

  • Tests added and pass
  • Adequate documentation added
  • (optional) Added Screenshots or videos
Original prompt

This section details on the original issue you should resolve

<issue_title>Cursor naming is an ad-hoc mix of "standards"</issue_title>
<issue_description>We have some cursor names that claim to be based on https://www.w3.org/TR/css-ui-3/#propdef-cursor:

// Cursor names are from CSS3: https://www.w3.org/TR/css-ui-3/#propdef-cursor

But these are neither complete, nor named according to the CSS reference.

We also try to map these to "xcursor" naming but there is no definitive list of xcursor names and current practice is to use the CSS list mentioned above.

We should probably adopt the CSS cursors throughout.

See also: #4522, and

case mir_resize_edge_southwest:
cursor_name = "bottom_left_corner";

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Add mir_diagonal_resize_top_to_left_cursor_name ("nw-resize")
- Add mir_diagonal_resize_bottom_to_left_cursor_name ("sw-resize")
- Update input.cpp to use new CSS cursor name constants
- Add xcursor mapping for new CSS names to legacy xcursor names

Co-authored-by: AlanGriffiths <9048879+AlanGriffiths@users.noreply.github.com>
Add sw-resize and nw-resize entries to default-theme.h to support CSS cursor names in builtin cursor fallback. This ensures cursor naming works consistently whether using XCursorLoader or BuiltinCursorImages.

Co-authored-by: AlanGriffiths <9048879+AlanGriffiths@users.noreply.github.com>
Document the design decision to duplicate pixel data for CSS cursor name aliases, explaining that the initializer_list structure requires this approach to maintain compatibility.

Co-authored-by: AlanGriffiths <9048879+AlanGriffiths@users.noreply.github.com>
Copilot AI changed the title [WIP] Update cursor naming to follow CSS standards Adopt CSS3 cursor naming throughout Dec 10, 2025
Copilot AI requested a review from AlanGriffiths December 10, 2025 17:40
@Saviq Saviq force-pushed the main branch 2 times, most recently from 39740d9 to 43ac49a Compare December 15, 2025 17:06
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.

Cursor naming is an ad-hoc mix of "standards"

2 participants