]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: fix focus when menu is closed by clicking its border
authortokyo4j <hrak1529@gmail.com>
Thu, 19 Dec 2024 08:04:10 +0000 (17:04 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Thu, 19 Dec 2024 15:43:06 +0000 (00:43 +0900)
Before this commit, the pointer focus is cleared when a menu is closed
by clicking its border. This is because get_cursor_context() returns
type=LAB_SSD_NONE when the cursor is on the menu border and
cursor_update_common() clears the pointer focus. This commit fixes this
by replacing cursor_update_common() with cursor_update_focus(), which
calls get_cursor_context() again after the menu scene-node is hidden.

src/input/cursor.c

index 5f76c908ea2ee0de51cef92fbc5a464693e9b135..225f836bae5b308a5ea43c613d2393c8e8f6842e 100644 (file)
@@ -1118,9 +1118,7 @@ cursor_process_button_release(struct seat *seat, uint32_t button,
                                menu_call_selected_actions(server);
                        } else {
                                menu_close_root(server);
-                               double sx, sy;
-                               cursor_update_common(server, &ctx, time_msec,
-                                       /*cursor_has_moved*/ false, &sx, &sy);
+                               cursor_update_focus(server);
                        }
                }
                return notify;