From 77b9b57c54dec9ff9675d488d69c07c6b7a54f1b Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.maroneze@cea.fr>
Date: Mon, 6 Dec 2021 16:57:54 +0100
Subject: [PATCH] [Gui] change cursor to avoid issues under WSLg

See https://git.frama-c.com/pub/frama-c/-/issues/2586.
Avoids issues when running WSLg under Ubuntu 20.04, with lablgtk3, on
Wayland, due to missing cursors (such as ARROW).
---
 src/plugins/gui/design.ml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/gui/design.ml b/src/plugins/gui/design.ml
index 67843ca7100..9df256c4c55 100644
--- a/src/plugins/gui/design.ml
+++ b/src/plugins/gui/design.ml
@@ -862,7 +862,14 @@ class main_window () : main_window_extension_points =
   let () = main_window#set_default_size ~width ~height in
   let () = main_window#set_geometry_hints ~min_size:(1,1) main_window#coerce in
   let watch_cursor = Gdk.Cursor.create `WATCH in
-  let arrow_cursor = Gdk.Cursor.create `ARROW in
+  (* NOTE: the ARROW cursor is not available under some specific configurations,
+     e.g. WSLg + lablgtk3 + Wayland; so we avoid using it here.
+     Testing indicates only the following cursors are available:
+     BOTTOM_LEFT_CORNER, BOTTOM_RIGHT_CORNER, BOTTOM_SIDE, CROSSHAIR, HAND1,
+     LEFT_PTR, LEFT_SIDE, RIGHT_SIDE, TOP_LEFT_CORNER, TOP_RIGHT_CORNER,
+     TOP_SIDE, WATCH, XTERM
+  *)
+  let arrow_cursor = Gdk.Cursor.create `LEFT_PTR in
 
   (* On top one finds the menubar *)
   let toplevel_vbox = GPack.box `VERTICAL ~packing:main_window#add () in
-- 
GitLab