From 4c48c60082b8582c5320fc8bbb6f82f512cd3c9d Mon Sep 17 00:00:00 2001 From: git-lakshy Date: Sat, 28 Feb 2026 12:40:55 +0530 Subject: [PATCH 1/2] [201_86] Reduce popup/screen flashing when inserting using Automatic content --- TeXmacs/progs/text/text-menu.scm | 10 ++++---- devel/201_86.md | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 devel/201_86.md diff --git a/TeXmacs/progs/text/text-menu.scm b/TeXmacs/progs/text/text-menu.scm index cf5289e01c..c36cd34acf 100644 --- a/TeXmacs/progs/text/text-menu.scm +++ b/TeXmacs/progs/text/text-menu.scm @@ -470,7 +470,7 @@ ("Table of contents" (begin (make-aux "table-of-contents" "toc-prefix" "toc") - (update-document "all"))) + (update-document "table-of-contents"))) (assuming (get-boolean-preference "gui:new bibliography dialogue") ("Bibliography" (open-bibliography-inserter))) (assuming (not (get-boolean-preference "gui:new bibliography dialogue")) @@ -481,21 +481,21 @@ ("Index" (begin (make-aux "the-index" "index-prefix" "idx") - (update-document "all"))) + (update-document "the-index"))) ("Glossary" (begin (make-aux "the-glossary" "glossary-prefix" "gly") - (update-document "all"))) + (update-document "the-glossary"))) ;;("List of figures" (make-aux* "the-glossary*" "figure-list-prefix" "figure" "List of figures")) ;;("List of tables" (make-aux* "the-glossary*" "table-list-prefix" "table" "List of tables")) ("List of figures" (begin (make-aux "list-of-figures" "figure-list-prefix" "figure") - (update-document "all"))) + (update-document "list-of-figures"))) ("List of tables" (begin (make-aux "list-of-tables" "table-list-prefix" "table") - (update-document "all")))) + (update-document "list-of-tables")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Text menus for inserting block content diff --git a/devel/201_86.md b/devel/201_86.md new file mode 100644 index 0000000000..c3e85ce70d --- /dev/null +++ b/devel/201_86.md @@ -0,0 +1,42 @@ +# 201_86: Reduce popup/screen flashing when inserting Automatic content + +### Issue #2814 : +When using `Insert -> Automatic -> Table of contents / Index / Glossary / List of figures / List of tables`, +the editor shows repeated popup/wait dialogs and visible screen disturbance. + +### How to Test + Open any text document with section/index/glossary markers. + Trigger each item via `Insert -> Automatic`: + - Table of contents + - Index + - Glossary + - List of figures + - List of tables + Content is inserted and generated as before. + No more popupo or screen flashing. + + +### What Changed +Changed update keys in `text-menu.scm`: + +```scheme +;; BEFORE +(update-document "all") + +;; AFTER (per item) +(update-document "table-of-contents") +(update-document "the-index") +(update-document "the-glossary") +(update-document "list-of-figures") +(update-document "list-of-tables") +``` +This keeps insertion behavior unchanged (`make-aux` still runs) while avoiding unnecessary full-update UI churn. + + +### Why +In `text-menu.scm`, each automatic insertion path called: +1. `make-aux ...` (insert placeholder) +2. `update-document "all"` (full document update) + +`"all"` triggers heavier update flow and repeated delayed passes, so users saw extra popups/refresh noise. + From f6122a5901da9ee0b6a1e9f8eda6da59f79d0b50 Mon Sep 17 00:00:00 2001 From: git-lakshy Date: Sat, 28 Feb 2026 22:03:02 +0530 Subject: [PATCH 2/2] [201_86] Remove popups causing screen flash when inserting Automatic content --- TeXmacs/progs/generic/document-edit.scm | 6 +++-- TeXmacs/progs/text/text-menu.scm | 10 ++++---- devel/201_86.md | 34 +++++++++---------------- src/Edit/Process/edit_process.cpp | 6 ++--- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/TeXmacs/progs/generic/document-edit.scm b/TeXmacs/progs/generic/document-edit.scm index ef466562fb..71d0644afc 100644 --- a/TeXmacs/progs/generic/document-edit.scm +++ b/TeXmacs/progs/generic/document-edit.scm @@ -582,10 +582,11 @@ ("document update times" "3" notify-doc-update-times)) (define (wait-update-current-buffer) - (system-wait "Updating current buffer, " "please wait") + (set-message "Updating current buffer ..." "please wait") (update-current-buffer)) (tm-define (update-document what) + (set-cursor-style "wait") (for (.. 0 doc-update-times) (delayed ; allow typesetting/magic to happen before next update (:idle 1) @@ -596,4 +597,5 @@ (generate-all-aux) (wait-update-current-buffer)) ((== what "buffer") (wait-update-current-buffer)) - (else (generate-aux what))))))) + (else (generate-aux what)))))) + (delayed (:idle 1) (set-cursor-style "normal"))) diff --git a/TeXmacs/progs/text/text-menu.scm b/TeXmacs/progs/text/text-menu.scm index c36cd34acf..cf5289e01c 100644 --- a/TeXmacs/progs/text/text-menu.scm +++ b/TeXmacs/progs/text/text-menu.scm @@ -470,7 +470,7 @@ ("Table of contents" (begin (make-aux "table-of-contents" "toc-prefix" "toc") - (update-document "table-of-contents"))) + (update-document "all"))) (assuming (get-boolean-preference "gui:new bibliography dialogue") ("Bibliography" (open-bibliography-inserter))) (assuming (not (get-boolean-preference "gui:new bibliography dialogue")) @@ -481,21 +481,21 @@ ("Index" (begin (make-aux "the-index" "index-prefix" "idx") - (update-document "the-index"))) + (update-document "all"))) ("Glossary" (begin (make-aux "the-glossary" "glossary-prefix" "gly") - (update-document "the-glossary"))) + (update-document "all"))) ;;("List of figures" (make-aux* "the-glossary*" "figure-list-prefix" "figure" "List of figures")) ;;("List of tables" (make-aux* "the-glossary*" "table-list-prefix" "table" "List of tables")) ("List of figures" (begin (make-aux "list-of-figures" "figure-list-prefix" "figure") - (update-document "list-of-figures"))) + (update-document "all"))) ("List of tables" (begin (make-aux "list-of-tables" "table-list-prefix" "table") - (update-document "list-of-tables")))) + (update-document "all")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Text menus for inserting block content diff --git a/devel/201_86.md b/devel/201_86.md index c3e85ce70d..40cc4c651b 100644 --- a/devel/201_86.md +++ b/devel/201_86.md @@ -1,4 +1,4 @@ -# 201_86: Reduce popup/screen flashing when inserting Automatic content +# 201_86: Remove popups causing screen flash when inserting Automatic content ### Issue #2814 : When using `Insert -> Automatic -> Table of contents / Index / Glossary / List of figures / List of tables`, @@ -6,37 +6,27 @@ the editor shows repeated popup/wait dialogs and visible screen disturbance. ### How to Test Open any text document with section/index/glossary markers. - Trigger each item via `Insert -> Automatic`: + Trigger any of this via `Insert -> Automatic`: - Table of contents - Index - Glossary - List of figures - List of tables - Content is inserted and generated as before. - No more popupo or screen flashing. + Content will be inserted just like before but without popup, Wait cursor appears during the update and resets after. (wait cursor may not be visible due to fast update) + Instead of popup now "Updating current buffer ..." message is shown in status bar. ### What Changed -Changed update keys in `text-menu.scm`: -```scheme -;; BEFORE -(update-document "all") +#### `document-edit.scm`: `system-wait` → `set-message` + wait cursor +- Replaced popup dialog with footer status bar message +- Added `set-cursor-style "wait"/"normal"` around `update-document` -;; AFTER (per item) -(update-document "table-of-contents") -(update-document "the-index") -(update-document "the-glossary") -(update-document "list-of-figures") -(update-document "list-of-tables") -``` -This keeps insertion behavior unchanged (`make-aux` still runs) while avoiding unnecessary full-update UI churn. +#### `edit_process.cpp`: `system_wait` → `set_message` +Replaced popup in `generate_bibliography`, `generate_index`, `generate_glossary`. ### Why -In `text-menu.scm`, each automatic insertion path called: -1. `make-aux ...` (insert placeholder) -2. `update-document "all"` (full document update) - -`"all"` triggers heavier update flow and repeated delayed passes, so users saw extra popups/refresh noise. - +`system-wait` created popup overlays via `show_wait_indicator` in `qt_gui.cpp`. With 3 update passes +(`doc-update-times=3`), this produced 3-12 popup flashes per operation. Replaced with `set-message` +(footer bar) and `set-cursor-style "wait"` (spinning cursor) for non-intrusive feedback. \ No newline at end of file diff --git a/src/Edit/Process/edit_process.cpp b/src/Edit/Process/edit_process.cpp index 8b659b1d51..b36f2bbc57 100644 --- a/src/Edit/Process/edit_process.cpp +++ b/src/Edit/Process/edit_process.cpp @@ -113,7 +113,7 @@ edit_process_rep::generate_bibliography (string bib, string style, string fname) { #ifdef USE_PLUGIN_BIBTEX if (N (style) == 0) style= "tm-plain"; - system_wait ("Generating bibliography, ", "please wait"); + set_message ("Generating bibliography ... ", "please wait"); if (DEBUG_AUTO) debug_automatic << "Generating bibliography" << " [" << bib << ", " << style << ", " << fname << "]\n"; @@ -420,7 +420,7 @@ make_entry (tree& D, tree t, hashmap refs, bool rec) { void edit_process_rep::generate_index (string idx) { - system_wait ("Generating index, ", "please wait"); + set_message ("Generating index ...", "please wait"); if (DEBUG_AUTO) debug_automatic << "Generating index [" << idx << "]\n"; tree I= copy (buf->data->aux[idx]); hashmap R= buf->data->ref; @@ -467,7 +467,7 @@ edit_process_rep::generate_index (string idx) { void edit_process_rep::generate_glossary (string gly) { - system_wait ("Generating glossary, ", "please wait"); + set_message ("Generating glossary ...", "please wait"); if (DEBUG_AUTO) debug_automatic << "Generating glossary [" << gly << "]\n"; tree G= copy (buf->data->aux[gly]); if (buf->prj != NULL) G= copy (buf->prj->data->aux[gly]);