Skip to content

Commit fe9dce3

Browse files
committed
remove item from old popup host (#615)
1 parent cede73e commit fe9dce3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/popup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ static bool popup_contains_item(struct popup* popup, struct bar_item* bar_item)
267267

268268
void popup_add_item(struct popup* popup, struct bar_item* bar_item) {
269269
if (popup_contains_item(popup, bar_item)) return;
270+
if (bar_item->parent) {
271+
popup_remove_item(&bar_item->parent->popup, bar_item);
272+
}
270273
popup->num_items++;
271274
popup->items = realloc(popup->items,
272275
sizeof(struct bar_item*)*popup->num_items);

0 commit comments

Comments
 (0)