Skip to content

[Bug]: Progress popup flickers continuously during conversion on Linux X11 #45

Description

@jimmerricks

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions