GaZaTu / im-emoji-picker

emoji picker compatible with Linux systems using either XServer or Wayland with either Fcitx5 or IBus
MIT License
45 stars 3 forks source link

[KDE/Wayland/fcitx5] Emoji picker appears and then vanishes immediately #13

Closed milas closed 10 months ago

milas commented 1 year ago

Splitting this out from the conversation in #11:

ok the only thing i can imagine at this point is that there must be some kind of bug with KDE (wayland) + fcitx5 because fcitx immediately sends the deactivate event after the window opens (which is obviously wrong) and then it goes dark. if i start the fcitx daemon with QT_QPA_PLATFORM=xcb it kinda works but that's obviously no solution.

Originally posted by @GaZaTu in https://github.com/GaZaTu/im-emoji-picker/issues/11#issuecomment-1657235748

I filed an upstream issue with @ fcitx/fcitx5#887, and the maintainer responded:

That's however, not a solvable issue from fcitx side.

Mainly it's because that the emoji picker itself embeds Qt and it will grab the focus away on wayland. that's why you see the deactivate event.


At this point, it's not clear to me where the issue lies - is this a kwin thing? Why do we not see the same behavior under X11?

For reference, here's my system configuration:

KWin version: 5.27.9
Qt Version: 5.15.10
Qt compile version: 5.15.10
XCB compile version: 1.16

fcitx version: 5.1.1
Kernel: 6.5.9

I also tried using latest HEAD from both fcitx + im-emoji-picker.

GaZaTu commented 1 year ago

im wasted af rn but i know the issue: under @milas wayland qt always steals focus which is bad in this case. if u want to use this prohect youll need to create a window rule to disable focus for now

On Sat, Oct 28, 2023, 16:29 Milas Bowman @.***> wrote:

Splitting this out from the conversation in #11 https://github.com/GaZaTu/im-emoji-picker/issues/11:

ok the only thing i can imagine at this point is that there must be some kind of bug with KDE (wayland) + fcitx5 because fcitx immediately sends the deactivate event after the window opens (which is obviously wrong) and then it goes dark. if i start the fcitx daemon with QT_QPA_PLATFORM=xcb it kinda works but that's obviously no solution.

Originally posted by @GaZaTu https://github.com/GaZaTu in #11 (comment) https://github.com/GaZaTu/im-emoji-picker/issues/11#issuecomment-1657235748

I filed an upstream issue with fcitx5 @ fcitx/fcitx5#887 https://github.com/fcitx/fcitx5/issues/887, and the maintainer responded:

That's however, not a solvable issue from fcitx side.

Mainly it's because that the emoji picker itself embeds Qt and it will grab the focus away on wayland. that's why you see the deactivate event.


At this point, it's not clear to me where the issue lies - is this a kwin thing? Why do we not see the same behavior under X11?

— Reply to this email directly, view it on GitHub https://github.com/GaZaTu/im-emoji-picker/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFP5YVACXHS45ILBTKQUYLYBUJF3AVCNFSM6AAAAAA6UECXYWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3DMNRRGY3DEMI . You are receiving this because you were mentioned.Message ID: @.***>

shadmansaleh commented 10 months ago

Any update on this? I think I'm facing same issue with ibus-wayland on kde too.

GaZaTu commented 10 months ago

@shadmansaleh i did not look into this again but i doubt anything changed yet. There currently does not seem to be a way to tell Qt "open a new window but do not take focus" when using wayland.

So the only way for now seems to be a custom window rule in the KDE settings. (which is what i did)

milas commented 10 months ago

For reference, here's what my ~/.config/kwinrulesrc looks like:

[1]
Description=Emoji Picker
acceptfocusrule=2
title=im-emoji-picker
titlematch=2
types=1

[General]
count=1
rules=1

Configuring it in the GUI: Screenshot of the KDE Window Rules configuration pane with a rule targeting window title of "im-emoji-picker" and setting "Accept Focus" to "Force" and "No"


Things are working well for me since applying that change on KDE 5.27.10 + Wayland (on NixOS unstable) using fcitx5.

Thanks for this, it's pretty great. Maybe Qt6 will fix things? 🫣 <-- emoji typed with im-emoji-picker

milas commented 10 months ago

btw I had to launch Firefox under xwayland to respond to this issue. This issue literally breaks input on Firefox+Wayland for me. Specifically this issue. I can comment on other GitHub issues but not this one.

(This has nothing to do with im-emoji-picker. It happens even without fcitx5 running. I have no explanation and don't even know how to report that as a bug to Firefox, so I felt like sharing here 😛)

GaZaTu commented 10 months ago

lol that is oddly specific. i did not have that happen before but i guess i don't comment on too many issues. and glad you're still enjoying the emoji picker 😙

zelch commented 8 months ago

@GaZaTu Sorry to resurrect a dead bug, but could we get a note about this in the README?

I spent some time trying to figure it out before stumbling across this closed bug.

GaZaTu commented 8 months ago

done @zelch 👌