]> uap-core.de Git - note.git/commitdiff
add workaround for toolkit doc attachment bug
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 23 Oct 2025 18:39:25 +0000 (20:39 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 23 Oct 2025 18:39:25 +0000 (20:39 +0200)
application/notebook.c

index 89cc77f2216c1ffa33e20bc12eb00e31bdec4408..ac8a3aa7704a6fea7681edda16e6e0126cd9a980 100644 (file)
@@ -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);