winit icon indicating copy to clipboard operation
winit copied to clipboard

Replace libxcursor with custom cursor code

Open notgull opened this issue 1 year ago • 1 comments

Another one bites the dust.

This replaces the code dependent on libxcursor with equivalent code written using x11rb, featuring its special "cursor" module.

cc #3198

  • [x] Tested on all platforms changed
  • [x] Added an entry to the changelog module if knowledge of this change could be valuable to users
  • [x] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • [x] Created or updated an example program if it would help users understand this functionality
  • [x] Updated feature matrix, if new features were added or implemented

notgull avatar Jun 22 '24 19:06 notgull

Meeting resolution: @kchibisov will take a look once he has time

madsmtm avatar Jun 28 '24 15:06 madsmtm

@kchibisov Have you had a chance to look over this one yet?

notgull avatar Jul 28 '24 14:07 notgull

X11 sits on top of the I/O stack and every I/O function is fallible. So every winit function would also need to return a Result. Not that I oppose this; I think this is the ideal way to go.

notgull avatar Aug 02 '24 03:08 notgull

X11 sits on top of the I/O stack and every I/O function is fallible. So every winit function would also need to return a Result. Not that I oppose this; I think this is the ideal way to go.

I made #3844 to address at least this PR. So for this PR I propose:

  • Return an error in create_custom_cursor().
  • If an error happens in set_cursor(), use tracing to deliver the error and do nothing instead of panicking. Lets address this in the future more globally.

WDYT?

daxpedda avatar Aug 02 '24 09:08 daxpedda

Yeah, in general, if you can not set something you just do nothing. There's no guarantee that all the functions will work, because window manager can just ignore the request and you generally don't know that until you try to query it.

So just ignore the errors for setting cursor(that's how it's done on Wayland as well here).

kchibisov avatar Aug 05 '24 10:08 kchibisov

  • Return an error in create_custom_cursor().

  • If an error happens in set_cursor(), use tracing to deliver the error and do nothing instead of panicking. Lets address this in the future more globally.

I've set this up now.

notgull avatar Aug 10 '24 02:08 notgull