Skip to content

Commit 61b1f17

Browse files
committed
On Wayland, fix cursor icon updates on window borders when using CSD
1 parent c1b93fc commit 61b1f17

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- On X11, generate synthetic key events for keys held when a window gains or loses focus.
1818
- On X11, issue a `CursorMoved` event when a `Touch` event occurs,
1919
as X11 implicitly moves the cursor for such events.
20+
- On Wayland, fix cursor icon updates on window borders when using CSD.
2021

2122
# 0.20.0 Alpha 4 (2019-10-18)
2223

src/platform_impl/linux/wayland/pointer.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ pub fn implement_pointer<T: 'static>(
5656
let wid = store.find_wid(&surface);
5757
if let Some(wid) = wid {
5858
mouse_focus = Some(wid);
59+
60+
// Reload cursor style only when we enter winit's surface. Calling
61+
// this function every time on `PtrEvent::Enter` could interfere with
62+
// SCTK CSD handling, since it changes cursor icons when you hover
63+
// cursor over the window borders.
64+
cursor_manager.reload_cursor_style();
65+
5966
sink.send_window_event(
6067
WindowEvent::CursorEntered {
6168
device_id: crate::event::DeviceId(
@@ -75,8 +82,6 @@ pub fn implement_pointer<T: 'static>(
7582
wid,
7683
);
7784
}
78-
79-
cursor_manager.reload_cursor_style();
8085
}
8186
PtrEvent::Leave { surface, .. } => {
8287
mouse_focus = None;

0 commit comments

Comments
 (0)