]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: cursor_name fix
authorJohan Malm <jgm323@gmail.com>
Wed, 3 Mar 2021 21:19:52 +0000 (21:19 +0000)
committerJohan Malm <jgm323@gmail.com>
Wed, 3 Mar 2021 21:19:52 +0000 (21:19 +0000)
The current implementation detects resize edges over the wlr_surface,
sometimes preventing the correct cursor_name to be set.

src/cursor.c

index be9cd44e658e3dea0a0d4343189ef2fd8000d4f7..1da84fd9216ff9fec33ef2ccefc98f364347ade1 100644 (file)
@@ -2,8 +2,14 @@
 #include "labwc.h"
 #include "menu/menu.h"
 
-#define RESIZE_BORDER_WIDTH 4
-
+#define RESIZE_BORDER_WIDTH 2
+
+/*
+ * TODO: refactor code to get rid of get_resize_edges()
+ * Use a wl_list of SSD instead and build RESIZE_BORDER_WIDTH into that.
+ * Had to set RESIZE_BORDER_WIDTH to 2 for the time being to get 
+ * cursor_name to behave properly when entering surface
+ */
 static uint32_t
 get_resize_edges(struct view *view, double x, double y)
 {
@@ -172,8 +178,10 @@ process_cursor_motion(struct server *server, uint32_t time)
                }
                if (resize_edges) {
                        cursor_name_set_by_server = true;
-               }
-               if (!resize_edges && cursor_name_set_by_server) {
+               } else if (view_area != LAB_DECO_NONE) {
+                       cursor_name = XCURSOR_DEFAULT;
+                       cursor_name_set_by_server = true;
+               } else if (cursor_name_set_by_server) {
                        cursor_name = XCURSOR_DEFAULT;
                        cursor_name_set_by_server = false;
                }