Skip to content

Refine Window::set_cursor_grab API#2329

Merged
kchibisov merged 3 commits intorust-windowing:masterfrom
kchibisov:cursor-locking-api
Jun 13, 2022
Merged

Refine Window::set_cursor_grab API#2329
kchibisov merged 3 commits intorust-windowing:masterfrom
kchibisov:cursor-locking-api

Conversation

@kchibisov
Copy link
Copy Markdown
Member

This commit renames Window::set_cursor_grab to
Window::set_cursor_grab_mode. The new API now accepts enumeration
to control the way cursor grab is performed. The value could be: lock,
confine, or none.

This commit also implements Window::set_cursor_position for Wayland,
since it's tied to locked cursor.

Implements API from #1677.

Copy link
Copy Markdown
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Nice, we should definitely do this!

Copy link
Copy Markdown
Member

@maroider maroider left a comment

Choose a reason for hiding this comment

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

I like what you're going for here

@kchibisov kchibisov requested review from madsmtm and maroider June 12, 2022 07:20
@kchibisov kchibisov force-pushed the cursor-locking-api branch from 5feeb0b to 260eeb2 Compare June 12, 2022 07:21
This commit renames `Window::set_cursor_grab` to
`Window::set_cursor_grab_mode`. The new API now accepts enumeration
to control the way cursor grab is performed. The value could be: `lock`,
`confine`, or `none`.

This commit also implements `Window::set_cursor_position` for Wayland,
since it's tied to locked cursor.

Implements API from rust-windowing#1677.
Copy link
Copy Markdown
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@kchibisov kchibisov force-pushed the cursor-locking-api branch from 260eeb2 to 84007e3 Compare June 12, 2022 08:58
@kchibisov kchibisov merged commit 9e6f666 into rust-windowing:master Jun 13, 2022
@kchibisov kchibisov deleted the cursor-locking-api branch June 13, 2022 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add set_cursor_lock and distinguish between grabbing (confining) cursor and locking cursor

4 participants