Skip to content

Draft Window Inconsistently Loses Text On Submit #2173

@cdrch

Description

@cdrch

When using draft submit to send text from the Draft Window back to another application, sometimes several characters are lost from the start. This is very inconsistent, sometimes dropping 0 characters, and other times dropping 4-5. Occasionally, it will entirely fail to copy over anything.

I tested this by repeatedly doing draft edit all (which worked fine) and then draft submit, which should have simply placed the words back in the original spot, but fails in one of the ways I described about half the time.

Additionally, I tried removing the Draft Editor to ensure the overlapping draft submit commands could not interfere, but this made no difference.

This was brought up in #1695 previously. It is also mentioned in talonvoice/talon#254 (comment), but I'm unclear whether Talon or Draft Window is at fault. However, it seems there is a simple fix that Community can introduce.

I believe the issue is that the Draft Window command begins sending text prior to the other application regaining full focus. The switching time is dependent on computer performance and application responsiveness, and thus seemingly random. This is supported by an app.notify(content) line at the end of draft submit showing the full context, meaning that user.draft_get_text() is not failing. It is also supported by a simple sleep(50ms) just before insert(content) in draft submit being enough to make the program work consistently. I am unsure if this is an ideal solution, however, as the time is likely to be very machine-dependent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions