Skip to content

Commit

Permalink
event: fix notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed May 16, 2021
1 parent 0d306e8 commit 67110bb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions alternates.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ enum CommandResult parse_alternates(struct Buffer *buf, struct Buffer *s,

mutt_grouplist_destroy(&gl);

notify_send(AlternatesNotify, NT_ATTACH, NT_ATTACH_ADD, NULL);
notify_send(AlternatesNotify, NT_ALTERN, NT_ALTERN_ADD, NULL);

return MUTT_CMD_SUCCESS;

Expand Down Expand Up @@ -139,7 +139,7 @@ enum CommandResult parse_unalternates(struct Buffer *buf, struct Buffer *s,

} while (MoreArgs(s));

notify_send(AlternatesNotify, NT_ATTACH, NT_ATTACH_DELETE, NULL);
notify_send(AlternatesNotify, NT_ALTERN, NT_ALTERN_DELETE, NULL);

return MUTT_CMD_SUCCESS;
}
Expand Down
4 changes: 2 additions & 2 deletions core/account.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ bool account_mailbox_remove(struct Account *a, struct Mailbox *m)
{
if (!m || (np->mailbox == m))
{
struct EventMailbox ev_m = { m };
notify_send(a->notify, NT_MAILBOX, NT_MAILBOX_REMOVE, &ev_m);
struct EventMailbox ev_m = { np->mailbox };
notify_send(np->mailbox->notify, NT_MAILBOX, NT_MAILBOX_REMOVE, &ev_m);
STAILQ_REMOVE(&a->mailboxes, np, MailboxNode, entries);
notify_set_parent(np->mailbox->notify, NULL);
if (!m)
Expand Down
8 changes: 2 additions & 6 deletions gui/mutt_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,8 @@ static void window_recalc(struct MuttWindow *win)
return;

if (win->recalc)
{
win->recalc(win);
win->actions &= ~WA_RECALC;
}
win->actions &= ~WA_RECALC;

struct MuttWindow *np = NULL;
TAILQ_FOREACH(np, &win->children, entries)
Expand All @@ -718,10 +716,8 @@ static void window_repaint(struct MuttWindow *win, bool force)
return;

if (win->repaint && (force || (win->actions & WA_REPAINT)))
{
win->repaint(win);
win->actions &= ~WA_REPAINT;
}
win->actions &= ~WA_REPAINT;

struct MuttWindow *np = NULL;
TAILQ_FOREACH(np, &win->children, entries)
Expand Down
8 changes: 4 additions & 4 deletions helpbar/helpbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ static int helpbar_window_observer(struct NotifyCallback *nc)
return 0;

mutt_debug(LL_NOTIFY, "delete\n");
notify_observer_remove(nc->current, helpbar_binding_observer, win_helpbar);
notify_observer_remove(nc->current, helpbar_color_observer, win_helpbar);
notify_observer_remove(nc->current, helpbar_config_observer, win_helpbar);
notify_observer_remove(nc->current, helpbar_window_observer, win_helpbar);
notify_observer_remove(NeoMutt->notify, helpbar_binding_observer, win_helpbar);
notify_observer_remove(NeoMutt->notify, helpbar_color_observer, win_helpbar);
notify_observer_remove(NeoMutt->notify, helpbar_config_observer, win_helpbar);
notify_observer_remove(NeoMutt->notify, helpbar_window_observer, win_helpbar);
}
return 0;
}
Expand Down
7 changes: 3 additions & 4 deletions sidebar/observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,10 @@ static int sb_config_observer(struct NotifyCallback *nc)
mutt_str_equal(ev_c->name, "sidebar_divider_char"))
{
struct SidebarWindowData *wdata = sb_wdata_get(win);
WindowActionFlags action = calc_divider(wdata);
if (action == WA_REFLOW)
if (calc_divider(wdata))
{
win->parent->actions |= WA_REFLOW;
else
win->actions |= action;
}
return 0;
}

Expand Down

0 comments on commit 67110bb

Please sign in to comment.