Skip to content

Pasting text from a Qt application to Firefox sometimes fails #702

@tgn-ff

Description

@tgn-ff

STR:

  1. Open a Firefox window.
  2. Copy some text from a Qt application. I used KDE's Kate.
  3. Paste the text in Firefox's urlbar.
  4. Copy some other text from the Qt application.
  5. Open a new tab in Firefox and try to paste it in the urlbar.

Results:

The text needs a lot of tries (Ctrl + V) before it is, actually, pasted. fitx5 needs to be running, but not necessarily be in use, ie. it happens when English is the selected language (with the IME off).

One workaround is to set Ctrl + V (same as system's clipboard) as the "Paste Primary" shortcut in the Clipboard Module. I'm not sure if this causes some other input issues I have, though.


I ran a bisection and ended up at the following commit as the culprit:

commit c7725763d1b608161233ef62396a073a6004c27d
Author: Weng Xuetian <wengxt@gmail.com>
Date:   Sat Nov 12 09:58:04 2022 -0800

    Seems firefox doesn't like the batch mode call sequence.
    
    ProcessKeyEventBatch is introduced to mainly workaround Gtk4 limitation.
    While it does helps and ideally it should work on gtk2, and gtk3,
    certain app (namely firefox) doesn't like it. So lets just revert gtk2/3
    back to the old behavior, since they have been working well and no one
    complain about it. hangul case is tested, gtk3 works well and
    fcitx/fcitx5#445 does not happen.
    
    Fix fcitx/fcitx5-gtk#22

 fcitx-gclient/fcitxgclient.c | 45 ++++++++++++++++++++++++++++++++++++--------
 fcitx-gclient/fcitxgclient.h |  2 ++
 gtk2/fcitximcontext.cpp      |  1 +
 gtk3/fcitximcontext.cpp      |  1 +
 4 files changed, 41 insertions(+), 8 deletions(-)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions