winit: Allow moving the cursor
It is not necessary to set the cursor position on winit since the windowing system already updates the position on its own. Instead, doing this makes the cursor (almost) stuck and unmovable. Thus, this commit just removes that code from the winit backend. Fixes: https://github.com/Smithay/smithay/issues/241 Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
4d012e17a0
commit
a7f18e5deb
|
@ -251,14 +251,13 @@ impl CursorBackend for WinitGraphicsBackend {
|
||||||
type CursorFormat = CursorIcon;
|
type CursorFormat = CursorIcon;
|
||||||
type Error = ();
|
type Error = ();
|
||||||
|
|
||||||
fn set_cursor_position(&self, x: u32, y: u32) -> ::std::result::Result<(), ()> {
|
fn set_cursor_position(&self, _x: u32, _y: u32) -> ::std::result::Result<(), ()> {
|
||||||
debug!(self.logger, "Setting cursor position to {:?}", (x, y));
|
// With other backends, we read events from input devices and then have to position the
|
||||||
self.window
|
// mouse cursor on screen accordingly. Here, there is already a windowing system that deals
|
||||||
.window()
|
// with the position on screen. If we "force" out idea of the cursor position here, that
|
||||||
.set_cursor_position(LogicalPosition::new(x as f64, y as f64))
|
// breaks and e.g. the cursor on X11 becomes stuck and cannot move. (Us forcing a cursor
|
||||||
.map_err(|err| {
|
// position generates a mouse move event and thus we force the same cursor position again.)
|
||||||
debug!(self.logger, "{}", err);
|
Ok(())
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_cursor_representation(
|
fn set_cursor_representation(
|
||||||
|
|
Loading…
Reference in New Issue