From 61b1f17499f60fb8edc0c89f73dd8f7607239545 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 18 Dec 2019 02:27:01 +0300 Subject: [PATCH 1/2] On Wayland, fix cursor icon updates on window borders when using CSD --- CHANGELOG.md | 1 + src/platform_impl/linux/wayland/pointer.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 801eb1162d..21004a63c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - On X11, generate synthetic key events for keys held when a window gains or loses focus. - On X11, issue a `CursorMoved` event when a `Touch` event occurs, as X11 implicitly moves the cursor for such events. +- On Wayland, fix cursor icon updates on window borders when using CSD. # 0.20.0 Alpha 4 (2019-10-18) diff --git a/src/platform_impl/linux/wayland/pointer.rs b/src/platform_impl/linux/wayland/pointer.rs index cad299e470..d2785bfe98 100644 --- a/src/platform_impl/linux/wayland/pointer.rs +++ b/src/platform_impl/linux/wayland/pointer.rs @@ -56,6 +56,13 @@ pub fn implement_pointer( let wid = store.find_wid(&surface); if let Some(wid) = wid { mouse_focus = Some(wid); + + // Reload cursor style only when we enter winit's surface. Calling + // this function every time on `PtrEvent::Enter` could interfere with + // SCTK CSD handling, since it changes cursor icons when you hover + // cursor over the window borders. + cursor_manager.reload_cursor_style(); + sink.send_window_event( WindowEvent::CursorEntered { device_id: crate::event::DeviceId( @@ -75,8 +82,6 @@ pub fn implement_pointer( wid, ); } - - cursor_manager.reload_cursor_style(); } PtrEvent::Leave { surface, .. } => { mouse_focus = None; From ab8d502eb09004b79ca464c56ae37bba540bbabc Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 18 Dec 2019 13:33:23 +0300 Subject: [PATCH 2/2] Move changelog entry to a right place --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21004a63c5..b7e89bde18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- On Wayland, fix cursor icon updates on window borders when using CSD. + # # 0.20.0 Alpha 5 (2019-12-09) - On macOS, fix application termination on `ControlFlow::Exit` @@ -17,7 +19,6 @@ - On X11, generate synthetic key events for keys held when a window gains or loses focus. - On X11, issue a `CursorMoved` event when a `Touch` event occurs, as X11 implicitly moves the cursor for such events. -- On Wayland, fix cursor icon updates on window borders when using CSD. # 0.20.0 Alpha 4 (2019-10-18)