microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.09k stars 29.26k forks source link

Run code on wayland mode result on broken ibus connection #167757

Open noonsleeper opened 1 year ago

noonsleeper commented 1 year ago

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 ```
pm4rcin commented 1 year ago

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.

noonsleeper commented 1 year ago

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.

HubKing commented 1 year ago

@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?

deepak1556 commented 1 year ago

@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.

interestingLSY commented 1 year ago

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

escape0707 commented 1 year ago

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.

HubKing commented 1 year ago

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.

interestingLSY commented 1 year ago

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.

Sciroccogti commented 1 year ago

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
Kuro96 commented 11 months ago

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

LeileiChui commented 10 months ago

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
mawwalker commented 10 months ago

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.

HubKing commented 10 months ago

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
teohhanhui commented 8 months ago

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

HubKing commented 8 months ago

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.

noonsleeper commented 8 months ago

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

teohhanhui commented 8 months ago

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 commented 8 months ago

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:

amtoaer commented 6 months ago

@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?

ziyouwa commented 5 months ago

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
vvasuki commented 4 months ago

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.
renyuneyun commented 1 month ago

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.