mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-10 22:04:28 +00:00
catch NULL bar_item earlier
This commit is contained in:
parent
27db928fa6
commit
af35c54757
2 changed files with 1 additions and 3 deletions
|
@ -229,14 +229,12 @@ void bar_item_on_click(struct bar_item* bar_item) {
|
|||
}
|
||||
|
||||
void bar_item_mouse_entered(struct bar_item* bar_item) {
|
||||
if (!bar_item) return;
|
||||
bar_item->mouse_over = true;
|
||||
if (bar_item->update_mask & UPDATE_MOUSE_ENTERED)
|
||||
bar_item_update(bar_item, COMMAND_SUBSCRIBE_MOUSE_ENTERED, true);
|
||||
}
|
||||
|
||||
void bar_item_mouse_exited(struct bar_item* bar_item) {
|
||||
if (!bar_item) return;
|
||||
if (bar_item->mouse_over && (bar_item->update_mask & UPDATE_MOUSE_EXITED)) bar_item_update(bar_item, COMMAND_SUBSCRIBE_MOUSE_EXITED, true);
|
||||
bar_item->mouse_over = false;
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ void bar_manager_custom_events_trigger(struct bar_manager* bar_manager, char* na
|
|||
}
|
||||
|
||||
void bar_manager_handle_mouse_entered(struct bar_manager* bar_manager, struct bar_item* bar_item) {
|
||||
if (bar_item->mouse_over) return;
|
||||
if (!bar_item || bar_item->mouse_over) return;
|
||||
for (int i = 0; i < bar_manager->bar_item_count; i++)
|
||||
bar_item_mouse_exited(bar_item);
|
||||
|
||||
|
|
Loading…
Reference in a new issue