Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Wayland, log error for failure to set cursor #1991

Merged
merged 3 commits into from
Aug 15, 2021

Conversation

sbosnick
Copy link
Contributor

@sbosnick sbosnick commented Aug 11, 2021

Fixes: #1988

The inability to set the cursor using any of the named cursor files
likely indicates an error in the system on which we are running.
WinitPointer::set_cursor also does not have any way of returning an
error so just log the error to assist users in diagnosing the problem.

  • Tested on all platforms changed
  • Compilation warnings were addressed
  • cargo fmt has been run on this branch
  • cargo doc builds successfully
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

Fixes: rust-windowing#1988

The inability to set the cursor using any of the named cursor files
likely indicates an error in the system on which we are running.
WinitPointer::set_cursor also does not have any way of returning an
error so just log the error to assist users in diagnosing the problem.
@sbosnick
Copy link
Contributor Author

I haven't check the last four boxes on the check list for the commit because I haven't done anything related to what is described, but I don't believe this PR needs any of the items that are listed.

@maroider maroider added DS - wayland C - waiting on maintainer A maintainer must review this code labels Aug 11, 2021
}
}
error!("Failed to set cursor");
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit: This should maybe be a warning instead, since the system can easily continue without the cursor having been set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the error!() to a warn!(). This does make it a bit inconsistent with the same error as it is logged by smithay_client_toolkit::window::concept_frame, but that will likely be a non-issue if #1990 is merged (as the concept frame will be gone by then).

Add the cursor_icon which set_cursor was trying to set to the warning
message that it logs when it is unable to set any of the cursor icons it
is attempting to set.
@kchibisov kchibisov merged commit ceab0f8 into rust-windowing:master Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - waiting on maintainer A maintainer must review this code DS - wayland
Development

Successfully merging this pull request may close these issues.

WinitPointer::set_cursor fails silently on Wayland
4 participants