fcitx / fcitx5

maybe a new fcitx.
1.62k stars 118 forks source link

Can't switch between groups and input methods in steam chat. #910

Closed Steamvoker closed 10 months ago

Steamvoker commented 10 months ago

I'm on KDE using fcitx 5.1.5. Tried both X11 and Wayland. With and without environment variables (QT/GTK/SDL_IM_MODULE). While checking the issues I thought this is #442, but I'm not using modifier-only shortcuts; Ctrl + Space for IME and Meta + Space for group switching. Is that issue still not fixed or am I missing something?

wengxt commented 10 months ago

@Steamvoker input method never works in steam https://github.com/ValveSoftware/steam-for-linux/issues/3255

Steamvoker commented 10 months ago

Does that mean that switching groups also doesn't work because of that? Thank you for the answer!

wengxt commented 10 months ago

Switch group on X11 should always work. It's based on xcb key grab if there's no focused application.

Switch group on wayland you'll need to use this kcm in systemsettings. There's no other similar mechanism available under wayland to implement what I want.

图片

Steamvoker commented 10 months ago

Currently in KDE X11 session with these environment variables set:

XMODIFIERS=@im=fcitx
QT_IM_MODULE=fcitx
GTK_IM_MODULE=fcitx
SDL_IM_MODULE=fcitx

And the group enumaration set to Super+Space, it just puts one space in the chat instead of switching. By the way I can't switch groups at all when there's no active window. Do I need to have libxcb and/or libxcb-util installed?

wengxt commented 10 months ago

@Steamvoker can you post the output of fcitx5-diagnose? so we know the version and what’s being installed on the system.

Steamvoker commented 10 months ago

fcitx5-diagnose.txt

wengxt commented 10 months ago

@Steamvoker Can you run "fcitx5 -r --verbose=xcb=5" and paste the output here?

Steamvoker commented 10 months ago
fcitx5 -r --verbose=xcb=5
I2023-12-07 09:59:51.587278 instance.cpp:1323] Override Enabled Addons: {}
I2023-12-07 09:59:51.587304 instance.cpp:1324] Override Disabled Addons: {}
D2023-12-07 09:59:51.589055 xcbkeyboard.cpp:275] evdev pc104 us  
I2023-12-07 09:59:51.589519 xcbconnection.cpp:185] Connecting to X11 display, display name::0.
I2023-12-07 09:59:51.589697 addonmanager.cpp:193] Loaded addon xcb
D2023-12-07 09:59:51.589744 xcbeventreader.cpp:76] Start XCBEventReader thread
I2023-12-07 09:59:51.590402 addonmanager.cpp:193] Loaded addon quickphrase
I2023-12-07 09:59:51.590489 addonmanager.cpp:193] Loaded addon imselector
I2023-12-07 09:59:51.593101 addonmanager.cpp:193] Loaded addon keyboard
I2023-12-07 09:59:51.593996 addonmanager.cpp:193] Loaded addon dbus
I2023-12-07 09:59:51.594379 addonmanager.cpp:193] Loaded addon dbusfrontend
I2023-12-07 09:59:51.608578 addonmanager.cpp:193] Loaded addon fcitx4frontend
I2023-12-07 09:59:51.609114 addonmanager.cpp:193] Loaded addon ibusfrontend
I2023-12-07 09:59:51.609530 addonmanager.cpp:193] Loaded addon xim
E2023-12-07 09:59:51.610792 waylandmodule.cpp:208] Failed to open wayland connection
I2023-12-07 09:59:51.610808 addonmanager.cpp:193] Loaded addon wayland
I2023-12-07 09:59:51.611031 addonmanager.cpp:193] Loaded addon clipboard
I2023-12-07 09:59:51.611160 addonmanager.cpp:193] Loaded addon waylandim
I2023-12-07 09:59:51.611263 addonmanager.cpp:193] Loaded addon unicode
I2023-12-07 09:59:51.631441 inputmethodmanager.cpp:198] Found 737 input method(s) in addon keyboard
D2023-12-07 09:59:51.631594 xcbconnection.cpp:279] Grab key for X11 display: :0
D2023-12-07 09:59:51.631624 xcbconnection.cpp:254] grab keycode 65 modifiers 65
D2023-12-07 09:59:51.631719 xcbconnection.cpp:254] grab keycode 65 modifiers 64
D2023-12-07 09:59:51.631753 xcbkeyboard.cpp:165] (us, )
D2023-12-07 09:59:51.631765 xcbkeyboard.cpp:320] addNewLayout us 
D2023-12-07 09:59:51.631774 xcbkeyboard.cpp:362] RMLVO tuple: evdev pc104 us 
D2023-12-07 09:59:51.645141 xcbkeyboard.cpp:275] evdev pc104 us  
D2023-12-07 09:59:51.645163 xcbkeyboard.cpp:297] findLayoutIndex layout:us variant:
D2023-12-07 09:59:51.645173 xcbkeyboard.cpp:299] defaultLayouts:[us]
D2023-12-07 09:59:51.645185 xcbkeyboard.cpp:300] defaultVariants:[]
D2023-12-07 09:59:51.645197 xcbkeyboard.cpp:508] Lock group 0
I2023-12-07 09:59:51.645450 addonmanager.cpp:193] Loaded addon kimpanel
I2023-12-07 09:59:51.645600 addonmanager.cpp:193] Loaded addon virtualkeyboard
I2023-12-07 09:59:51.659966 classicui.cpp:75] Created classicui for x11 display::0
I2023-12-07 09:59:51.660001 addonmanager.cpp:193] Loaded addon classicui
I2023-12-07 09:59:51.660311 addonmanager.cpp:193] Loaded addon notificationitem
I2023-12-07 09:59:51.660644 addonmanager.cpp:193] Loaded addon notifications
D2023-12-07 09:59:51.663214 xcbkeyboard.cpp:567] XCB_XKB_NEW_KEYBOARD_NOTIFY
D2023-12-07 09:59:51.663284 xcbkeyboard.cpp:275] evdev pc104 us  
I2023-12-07 09:59:51.663928 kimpanel.cpp:116] Kimpanel new owner: 
I2023-12-07 09:59:51.663962 virtualkeyboard.cpp:223] VirtualKeyboard new owner: 
I2023-12-07 09:59:51.663991 portalsettingmonitor.cpp:91] A new portal show up, start a new query.
D2023-12-07 09:59:51.688525 xcbkeyboard.cpp:275] evdev pc104 us  
D2023-12-07 09:59:51.688935 xcbkeyboard.cpp:587] Apply Xmodmap.
Will write new themes to:  "/home/steamvoker/.local/share/fcitx5/themes/plasma"
Notify theme reloading.
I2023-12-07 09:59:52.837363 addonmanager.cpp:193] Loaded addon mozc
wengxt commented 10 months ago

So I can see

D2023-12-07 09:59:51.631594 xcbconnection.cpp:279] Grab key for X11 display: :0 D2023-12-07 09:59:51.631624 xcbconnection.cpp:254] grab keycode 65 modifiers 65 D2023-12-07 09:59:51.631719 xcbconnection.cpp:254] grab keycode 65 modifiers 64

This means it try to grab Super + space and Super + Shift + Space to initiate group switching

Does it produce any log when you try to press Super space?

I'd expect to see something like: 2023-12-07 05:01:22.734345 xcbconnection.cpp:412] Received key event from root 2023-12-07 05:01:22.734435 xcbconnection.cpp:307] Grab keyboard for display: :1 2023-12-07 05:01:22.734571 xcbconnection.cpp:517] Switch to group 1 2023-12-07 05:01:25.297037 xcbconnection.cpp:412] Received key event from root 2023-12-07 05:01:25.297128 xcbconnection.cpp:517] Switch to group 0 2023-12-07 05:01:26.371254 xcbconnection.cpp:412] Received key event from root 2023-12-07 05:01:26.371332 xcbconnection.cpp:517] Switch to group 1

Steamvoker commented 10 months ago

I doesn't do anything when steam chat is active or when there are no active windows. And this shows up when I press Super+Space in Discord:

D2023-12-07 22:15:23.837838 xcbkeyboard.cpp:165] (us, )
D2023-12-07 22:15:23.837859 xcbkeyboard.cpp:320] addNewLayout us 
D2023-12-07 22:15:23.837869 xcbkeyboard.cpp:362] RMLVO tuple: evdev pc104 us 
D2023-12-07 22:15:23.851305 xcbkeyboard.cpp:275] evdev pc104 us  
D2023-12-07 22:15:23.851326 xcbkeyboard.cpp:297] findLayoutIndex layout:us variant:
D2023-12-07 22:15:23.851340 xcbkeyboard.cpp:299] defaultLayouts:[us]
D2023-12-07 22:15:23.851352 xcbkeyboard.cpp:300] defaultVariants:[]
D2023-12-07 22:15:23.851365 xcbkeyboard.cpp:508] Lock group 0
D2023-12-07 22:15:23.851461 xcbkeyboard.cpp:567] XCB_XKB_NEW_KEYBOARD_NOTIFY
D2023-12-07 22:15:23.853313 xcbkeyboard.cpp:275] evdev pc104 us  
D2023-12-07 22:15:23.862888 xcbkeyboard.cpp:275] evdev pc104 us  
D2023-12-07 22:15:23.960108 xcbkeyboard.cpp:587] Apply Xmodmap.
Steamvoker commented 10 months ago

@wengxt pinging in case you missed my response.

Steamvoker commented 9 months ago

Since I can't properly switch between layout groups, I have decided to disable Allow Overriding System XKB Setting in XCB addon settings and just use fcitx5 for input method only. With this I set my layouts in KDE's settings and trigger input method in fcitx. This fixed my issue of not being able to switch layouts in Steam (although IME still doesn't work there, but I assume that's an issue on their end) and when there is no input field in focus. While not an ideal solution, it works. Hope this helps someone.

nntae commented 1 month ago

I'm also having this issue:

  1. I can only switch between layout groups when focusing a text input element.
  2. I can't switch between layout groups when there's no active window, or no text input element is focused on.
  3. On Steam, I can't switch between layout groups even when focusing a text input element. In fact, I also cannot paste the clipboard's contents.

I've tried everything that's been suggested in this thread.