vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Run code on wayland mode result on broken ibus connection

Open noonsleeper opened this issue 3 years ago • 21 comments

Type: Bug

Steps to Reproduce:

  1. start with:
code-insiders --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --ozone-platform=wayland

or

code --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --ozone-platform=wayland

Then try to type some Japanese chars only result on standard English chars.

When you run code on xwayland or x11 you can use ibus to write non-ascii characters without any problem.

VS Code version: Code - Insiders 1.74.0-insider (9908b3d5ae12691da5adc2f18e21a100ee8eeb58, 2022-11-30T05:33:53.125Z) OS version: Linux x64 5.15.0-53-generic Modes: Sandboxed: Yes

System Info
Item Value
CPUs AMD Ryzen 5 3600X 6-Core Processor (2 x 3799)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: disabled_off
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
Load (avg) 1, 0, 0
Memory (System) 15.63GB (13.89GB free)
Process Argv --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --ozone-platform=wayland --crash-reporter-id 898eeabe-6c40-44ae-a4ba-537d37586078
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vsdfh931:30280409
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
pylantcb52:30590116
pyindex848:30611229
nodejswelcome1:30587009
pyind779:30611226
dbltrim-noruby:30604474

noonsleeper avatar Nov 30 '22 18:11 noonsleeper

I've tried updated VSCodium (1.74) which suffered from the same bug in 1.73.1 as vscode and now it works natively on wayland for me without problems. Can't tell about CSDs since I use dwl WM and I don't use Japanese or similar languages but you should try @noonsleeper if the issue was fixed.

pm4rcin avatar Dec 12 '22 10:12 pm4rcin

I've tried updated VSCodium (1.74) which suffered from the same bug in 1.73.1 as vscode and now it works natively on wayland for me without problems. Can't tell about CSDs since I use dwl WM and I don't use Japanese or similar languages but you should try @noonsleeper if the issue was fixed.

Hey @pm4rcin, the issue is about code/code-insiders (running on wayland mode) can't connect with ibus in order to write on other languages, not about running on wayland.

noonsleeper avatar Dec 12 '22 14:12 noonsleeper

@deepak1556 What do you mean "Confirmation pending", has anyone succeeded in making Fcitx5 work when VS Code is launched with the parameters to enable Wayland? Chromium-based browsers need --gtk-version=4 to enable IME's like Fcitx when using Wayland, so if VS Code (or Electron, whatever, I don't know) does not support --gtk-version=4 , doesn't it confirm that VS Code can't use IME in Wayland?

HubKing avatar Jan 16 '23 07:01 HubKing

@HubKing thanks for the link to chromium issue, confirmation-pending was meant for the issue to be verified in a local setup. Also, yes Electron currently does not support GTK4, so that needs to be addressed first.

deepak1556 avatar Jan 16 '23 11:01 deepak1556

After upgrading to VSCode 1.77.3 from 1.72.2, I am able to use fcitx5 in vscode without any additional flags.

interestingLSY avatar Apr 17 '23 14:04 interestingLSY

After upgrading to VSCode 1.77.3 from 1.72.2, I am able to use fcitx5 in vscode without any additional flags.

How? What's your environment? Are you using XWayland or Wayland?

Note that this thread is about CJK IME support for VSCode on Wayland, because XWayland cause some issue under HiDPI and fractional scale, and X11 cause issue with multiply monitor and HiDPI, too.

escape0707 avatar Apr 18 '23 03:04 escape0707

After upgrading to VSCode 1.77.3 from 1.72.2, I am able to use fcitx5 in vscode without any additional flags.

How? What's your environment? Are you using XWayland or Wayland?

Note that this thread is about CJK IME support for VSCode on Wayland, because XWayland cause some issue under HiDPI and fractional scale, and X11 cause issue with multiply monitor and HiDPI, too.

He probably used X11 or XWayland. I just tested with VS Code 1.77.3. VS Code won't even start if I execute code --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4. I have to remove --gtk-version=4 to start it, but then Fcitx5 does not work.

HubKing avatar Apr 18 '23 06:04 HubKing

Yes, I was using XWayland. However, vscode looks blurry on my 4K monitor with fractional scaling enabled. After adding flags --enable-features=UseOzonePlatform --ozone-platform=wayland, it is no longer blurry, but I am unable to use fcitx5. If I add --gtk-version=4, vscode won't start.

interestingLSY avatar Apr 28 '23 08:04 interestingLSY

I installed visual-studio-code-bin from AUR, and also run into the same issue:

code --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 --verbose                                   ✔ 
Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'gtk-version' is not in the list of known options, but still passed to Electron/Chromium.
[126082:0526/180050.551764:WARNING:wayland_object.cc(144)] Binding to gtk_shell1 version 4 but version 5 is available.
[126082:0526/180050.551808:WARNING:wayland_object.cc(144)] Binding to zwp_pointer_gestures_v1 version 1 but version 3 is available.
[126082:0526/180050.551814:WARNING:wayland_object.cc(144)] Binding to wl_seat version 5 but version 8 is available.
[126082:0526/180050.551832:WARNING:wayland_object.cc(144)] Binding to zwp_linux_dmabuf_v1 version 3 but version 4 is available.
(process:126082): Gtk-ERROR **: 18:00:50.553: GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported

Sciroccogti avatar May 26 '23 10:05 Sciroccogti

code 1.84.2 running in native wayland, ibus-rime still not working

Kuro96 avatar Nov 21 '23 11:11 Kuro96

visual-studio-code-bin v1.85.1 in wayland, fcitx still not working, here is my code-flags config

    │ File: .config/code-flags.conf
    │ Size: 132 B
────┼──────────────────────────────────────────────────────────────
1   │ --enable-features=UseOzonePlatform,WaylandWindowDecorations
2   │ --enable-wayland-ime
3   │ --ozone-platform=wayland
4   │ --ozone-platform-hit=auto

LeileiChui avatar Dec 22 '23 14:12 LeileiChui

visual-studio-code-bin 1.85.1-1, Archlinux. I use code --enable-features=UseOzonePlatform --enable-features=WebRTCPipeWireCapturer --enable-features=WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime It works. You should remove the default params: --unity-launch. There is still a problem, the fcitx shows blur. Anyway, I can use fictx now.

mawwalker avatar Jan 12 '24 13:01 mawwalker

It works.

Doesn't work. visual-studio-code-bin 1.85.1-1, fcitx5 5.1.6-1

Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:47:11.635Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.6.10-arch1-1

HubKing avatar Jan 12 '24 18:01 HubKing

TL;DR: YMMV

https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#Chromium_.2F_Electron

Electron only supports --enable-wayland-ime, not --gtk-version=4, and this only works if text-input-v1 protocol is supported by your compositor. Please refer to the list:

https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#Support_in_Wayland_Compositor

teohhanhui avatar Mar 06 '24 17:03 teohhanhui

Please refer to the list:

So, Gnome doesn't support v1? I am using Gnome 45 and IME does not work on VS Code in native Wayland mode. Maybe the person who said it worked was using KDE.

HubKing avatar Mar 07 '24 17:03 HubKing

So, Gnome doesn't support v1? I am using Gnome 45 and IME does not work on VS Code in native Wayland mode. Maybe the person who said it worked was using KDE.

On KDE, also does not work, and this needs to work not only with fcitx5 but also with anthy and other IMEs

noonsleeper avatar Mar 07 '24 21:03 noonsleeper

On KDE, also does not work

Only KDE Plasma 5.27+ supports text-input-v1.

It definitely works for me with KDE Plasma (5.27.10) on Fedora Asahi Remix:

code --enable-features=WebRTCPipeWireCapturer,WaylandWindowDecorations --enable-wayland-ime --ozone-platform-hint=auto

Are you setting up fcitx5 as instructed? https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma

Go to System Settings > Input Devices > Virtual Keyboard. Select Fcitx 5 Wayland Launcher. Apply.

teohhanhui avatar Mar 08 '24 01:03 teohhanhui

Anyway, the upstream Chromium bug to follow is: https://issues.chromium.org/issues/40801194

And then it will have to trickle down to Electron, then to vscode... :hourglass:

teohhanhui avatar Mar 08 '24 02:03 teohhanhui

@teohhanhui Thanks for your solution. I'm using Arch Linux with Hyprland. After setting --enable-wayland-ime flag, I can type characters using fcitx5 in vscode. However, I've noticed that typing one character in the vscode terminal always results in two identical characters, which doesn't happen when typing in the editor. Have you encountered the same issue?

amtoaer avatar Apr 24 '24 08:04 amtoaer

On Gnome 45, fcitx5 works in foot, but not work with vscode and microsoft edge. It works in Hyprland.

Exec=/usr/bin/vscode -ozone-platform-hint=auto --enable-features=WebRTCPipeWireCapturer,WaylandWindowDecorations  --enable-wayland-ime --unity-launch %F

ziyouwa avatar May 16 '24 13:05 ziyouwa

Facing the same problem on mxlinux kde x11 -

vscode details:

Version: 1.90.2
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:33:48.698Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 6.1.0-21-amd64

Looks like I am not using wayland -

echo $XDG_SESSION_TYPE
x11

printf 'Session is: %s\n' "${DISPLAY:+X11}${WAYLAND_DISPLAY:+WAYLAND}"
Session is: X11

Couple of commands I tried:

$ code --enable-features=WebRTCPipeWireCapturer,WaylandWindowDecorations --enable-wayland-ime --ozone-platform-hint=auto

Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-wayland-ime' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'ozone-platform-hint' is not in the list of known options, but still passed to Electron/Chromium.
[vvasuki@vv2406:/] 2024-06-30 07:10:59
$ code --enable-features=UseOzonePlatform --enable-features=WebRTCPipeWireCapturer --enable-features=WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime
Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-wayland-ime' is not in the list of known options, but still passed to Electron/Chromium.

vvasuki avatar Jun 30 '24 01:06 vvasuki

However, I've noticed that typing one character in the vscode terminal always results in two identical characters, which doesn't happen when typing in the editor.

I'm encountering the same issue as @amtoaer for terminal. In fact, it's not two identical "characters", but it's the same input being repeated one more time.

renyuneyun avatar Sep 23 '24 15:09 renyuneyun

Anyway, the upstream Chromium bug to follow is: https://issues.chromium.org/issues/40801194

Got closed as wontfix :(

musjj avatar Nov 15 '24 16:11 musjj

Anyway, the upstream Chromium bug to follow is: https://issues.chromium.org/issues/40801194

Got closed as wontfix :(

They mention that will not work on fix gtk integration, but they are working on a proper solution base on wayland, I think that is better than the current solution. see

noonsleeper avatar Nov 15 '24 22:11 noonsleeper

However, I've noticed that typing one character in the vscode terminal always results in two identical characters, which doesn't happen when typing in the editor.

I'm encountering the same issue as @amtoaer for terminal. In fact, it's not two identical "characters", but it's the same input being repeated one more time.

Getting this same behavior when running with wayland and fcitx5

raulcesar avatar Jun 26 '25 23:06 raulcesar