From f6062a39790d24f92d00d5136a8ddc5ffe4b73a1 Mon Sep 17 00:00:00 2001 From: Steven Bosnick Date: Tue, 10 Aug 2021 19:50:46 -0400 Subject: [PATCH 1/3] On Wayland, log error for failure to set cursor 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. --- src/platform_impl/linux/wayland/seat/pointer/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform_impl/linux/wayland/seat/pointer/mod.rs b/src/platform_impl/linux/wayland/seat/pointer/mod.rs index 54be673fdb..9393ddcbe1 100644 --- a/src/platform_impl/linux/wayland/seat/pointer/mod.rs +++ b/src/platform_impl/linux/wayland/seat/pointer/mod.rs @@ -109,9 +109,10 @@ impl WinitPointer { let serial = Some(self.latest_serial.get()); for cursor in cursors { if self.pointer.set_cursor(cursor, serial).is_ok() { - break; + return; } } + error!("Failed to set cursor"); } /// Confine the pointer to a surface. From c4105c77bd971cee5e78607f9feec48a45cc960d Mon Sep 17 00:00:00 2001 From: Steven Bosnick Date: Wed, 11 Aug 2021 20:36:07 -0400 Subject: [PATCH 2/3] Change logging from error to warning --- src/platform_impl/linux/wayland/seat/pointer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform_impl/linux/wayland/seat/pointer/mod.rs b/src/platform_impl/linux/wayland/seat/pointer/mod.rs index 9393ddcbe1..dae30db512 100644 --- a/src/platform_impl/linux/wayland/seat/pointer/mod.rs +++ b/src/platform_impl/linux/wayland/seat/pointer/mod.rs @@ -112,7 +112,7 @@ impl WinitPointer { return; } } - error!("Failed to set cursor"); + warn!("Failed to set cursor"); } /// Confine the pointer to a surface. From dba02c5e324278fd9eb32990f32665053d850785 Mon Sep 17 00:00:00 2001 From: Steven Bosnick Date: Sat, 14 Aug 2021 09:15:39 -0400 Subject: [PATCH 3/3] Add context to the warning message 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. --- src/platform_impl/linux/wayland/seat/pointer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform_impl/linux/wayland/seat/pointer/mod.rs b/src/platform_impl/linux/wayland/seat/pointer/mod.rs index dae30db512..584069b1c2 100644 --- a/src/platform_impl/linux/wayland/seat/pointer/mod.rs +++ b/src/platform_impl/linux/wayland/seat/pointer/mod.rs @@ -112,7 +112,7 @@ impl WinitPointer { return; } } - warn!("Failed to set cursor"); + warn!("Failed to set cursor to {:?}", cursor_icon); } /// Confine the pointer to a surface.