What happened?
When triggering "Convert with Docling" from the right-click context menu, the progress popup window flickers rapidly and continuously for the entire duration of the conversion, only stopping when the result is returned. The UI is effectively unusable while a conversion is in progress.
What did you expect to happen?
The progress popup should appear once and remain visible and stable for the duration of the conversion.
Steps to reproduce
Click "Convert with Docling" from the right-click context menu.
Plugin version
0.3.3
Zotero version
9.0.4 (flatpak)
docling-serve version
1.12.0
Operating system
Linux
Transport mode
Sync (default)
Pipeline
Standard
Relevant logs
Anything else?
According to Claude, the cause is a focus-stealing loop. When conversion starts and Zotero has focus, startManagedProgress opens a Zotero.ProgressWindow. On Linux/X11, opening a transient popup window fires a blur event on the parent Zotero window at the OS level. This triggers onZoteroBlur, which closes the popup. The parent window then regains focus, firing focus, which triggers onZoteroFocus, which reopens the popup — and the cycle repeats indefinitely.
A working hotfix introduces a pinned flag on the managed progress state: when isZoteroFocused() is true at the moment conversion starts, the popup is marked pinned and onZoteroBlur/onZoteroFocus skip it entirely, leaving it open until the conversion completes. The blur/focus background-popup behaviour is preserved for the case where conversion is triggered while Zotero is not focused.
What happened?
When triggering "Convert with Docling" from the right-click context menu, the progress popup window flickers rapidly and continuously for the entire duration of the conversion, only stopping when the result is returned. The UI is effectively unusable while a conversion is in progress.
What did you expect to happen?
The progress popup should appear once and remain visible and stable for the duration of the conversion.
Steps to reproduce
Click "Convert with Docling" from the right-click context menu.
Plugin version
0.3.3
Zotero version
9.0.4 (flatpak)
docling-serve version
1.12.0
Operating system
Linux
Transport mode
Sync (default)
Pipeline
Standard
Relevant logs
Anything else?
According to Claude, the cause is a focus-stealing loop. When conversion starts and Zotero has focus,
startManagedProgressopens aZotero.ProgressWindow. On Linux/X11, opening a transient popup window fires ablurevent on the parent Zotero window at the OS level. This triggersonZoteroBlur, which closes the popup. The parent window then regains focus, firingfocus, which triggersonZoteroFocus, which reopens the popup — and the cycle repeats indefinitely.A working hotfix introduces a
pinnedflag on the managed progress state: whenisZoteroFocused()is true at the moment conversion starts, the popup is marked pinned andonZoteroBlur/onZoteroFocusskip it entirely, leaving it open until the conversion completes. The blur/focus background-popup behaviour is preserved for the case where conversion is triggered while Zotero is not focused.