From 04a2586f492f6f55efb3272716e077135a991006 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Thu, 23 Oct 2025 20:39:25 +0200 Subject: [PATCH] add workaround for toolkit doc attachment bug --- application/notebook.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/notebook.c b/application/notebook.c index 89cc77f..ac8a3aa 100644 --- a/application/notebook.c +++ b/application/notebook.c @@ -78,6 +78,15 @@ void notebookmodel_attach(MainWindow *window, NotebookModel *model) { } void notebookmodel_detach(NotebookModel *model) { + // TODO: workaround for a toolkit bug, that reattaching a document + // that has sub-documents will not update all bindings + if(model->current_note) { + //int i = ui_get(model->current_note->model->type); + //printf("type: %d\n", i); + ui_detach_document(model->ctx, model->current_note->model); + model->current_note = NULL; + } + if(model->current_note && model->current_note->model->modified) { //notebookmodel_detach_current_note(model); note_save(model->window->obj, model, model->current_note); -- 2.47.3