Skip to content

Commit f519812

Browse files
committedJan 29, 2025
improve mouse.clicked event reliability
1 parent 29c924f commit f519812

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/event.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ static void event_mouse_up(void* context) {
8181
wid,
8282
&window );
8383

84-
struct bar* bar = bar_manager_get_bar_by_wid(&g_bar_manager, wid);
85-
struct popup* popup = bar_manager_get_popup_by_wid(&g_bar_manager, wid);
86-
if (!bar_item && !popup && !bar) return;
87-
8884
if (!bar_item || bar_item->type == BAR_COMPONENT_GROUP) {
8985
bar_item = bar_manager_get_item_by_point(&g_bar_manager, point, &window);
9086
}
9187

88+
struct bar* bar = bar_manager_get_bar_by_wid(&g_bar_manager, wid);
89+
struct popup* popup = bar_manager_get_popup_by_wid(&g_bar_manager, wid);
90+
if (!bar_item && !popup && !bar) return;
91+
9292
CGPoint point_in_window_coords = CGPointZero;
9393
if (bar_item && window) {
9494
point_in_window_coords.x = point.x - window->origin.x;

0 commit comments

Comments
 (0)
Failed to load comments.