]> git.mdlowis.com Git - proto/labwc.git/commitdiff
desktop.c: don't print errors when cursor is on resize-indicator
authortokyo4j <hrak1529@gmail.com>
Sun, 7 Sep 2025 13:10:27 +0000 (22:10 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 7 Sep 2025 21:00:01 +0000 (22:00 +0100)
In f347a81, I thought there are only window contents and SSD under
`view->scene_tree` and forgot about the resize-indicator.

I also refactored the logic around it:
- Remove `ret.node->type == WLR_SCENE_NODE_BUFFER` check since it's
  already done by `lab_wlr_surface_from_node()`
- Eliminate duplicated call to `lab_wlr_surface_from_node()`

src/desktop.c

index 099c493bdbb7e47fd755f56ff61173be7a0f55ae..efd46dc5651ae444916c54fcb273612f3bfe3c61 100644 (file)
@@ -303,13 +303,12 @@ get_cursor_context(struct server *server)
                        case LAB_NODE_VIEW:
                        case LAB_NODE_XDG_POPUP:
                                ret.view = desc->view;
-                               if (ret.node->type == WLR_SCENE_NODE_BUFFER
-                                               && lab_wlr_surface_from_node(ret.node)) {
+                               ret.surface = lab_wlr_surface_from_node(ret.node);
+                               if (ret.surface) {
                                        ret.type = LAB_NODE_CLIENT;
-                                       ret.surface = lab_wlr_surface_from_node(ret.node);
                                } else {
-                                       /* should never be reached */
-                                       wlr_log(WLR_ERROR, "cursor not on client or ssd");
+                                       /* e.g. when cursor is on resize-indicator */
+                                       ret.type = LAB_NODE_NONE;
                                }
                                return ret;
                        case LAB_NODE_LAYER_SURFACE: