if (d->views /* FIXME always true */) {
points_attach(d, ret);
d->views[ret].owner = ci->focus;
- pane_add_notify(ci->home, ci->focus, "Notify:Close");
+ /* Use Close:Notify because we need this even
+ * when the pane is closing
+ */
+ pane_add_notify(ci->home, ci->focus, "Close:Notify");
}
return 1 + ret;
}
key_add(doc_default_cmd, "doc:add-view", &doc_addview);
key_add(doc_default_cmd, "doc:del-view", &doc_delview);
- key_add(doc_default_cmd, "Notify:Close", &doc_view_close);
+ key_add(doc_default_cmd, "Close:Notify", &doc_view_close);
key_add(doc_default_cmd, "doc:vmark-get", &doc_vmarkget);
key_add(doc_default_cmd, "doc:vmark-prev", &doc_vmarkprev);
key_add(doc_default_cmd, "doc:vmark-new", &doc_vmarknew);
list_del_init(&n->notifier_link);
if (strcmp(n->notification, "Notify:Close") == 0)
pane_call(n->notifiee, n->notification, p);
+ /* Close:Notify can be delivered even to DAMAGED_CLOSED
+ * panes
+ */
+ if (strcmp(n->notification, "Close:Notify") == 0)
+ pane_call(n->notifiee, n->notification, p);
free(n->notification);
free(n);
}
if (home)
ci.home = home;
if ((home->damaged & DAMAGED_CLOSED) &&
- strncmp(ci.key, "Close", 5) != 0 &&
- strcmp(ci.key, "Notify:Close") != 0)
+ ci.key[0] != 'C' && /* Compile will often optimise
+ * the strncmp away
+ */
+ strncmp(ci.key, "Close", 5) != 0)
/* This pane cannot accept anything but
- * "Close" or "Close:mark" or "Notify:Close"
+ * "Close" or "Close:mark" or "Close:Notify"
*/
return Efail;
ci.comm = home->handle;