Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

When chromium uses text-input-v1, it can only input in the first window

Open mxmf opened this issue 1 year ago • 6 comments

hyprctl version                                                                                                               
Hyprland, built from branch main at commit f49af187bc0755f9b5be9376bfd52c0cf12c1e11 dirty (Xdg config home support (2047)).
Tag: v0.26.0-96-gf49af187

flags: (if any)

Steps to reproduce

  1. lauch chromium with flags --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto --enable-wayland-ime
  2. type something, it worked well
  3. create a new window, type something, It only shows the candidate word panel and cannot actually write into the input box. Similar to the behavior of versions below electron21 mentioned at #1778 .

https://github.com/hyprwm/Hyprland/assets/37976818/c91ddbfe-222b-4ab8-8421-82718420c1dc

mxmf avatar Jul 14 '23 04:07 mxmf

why not use chromium with its much better text input protocol by using --gtk-version=4?

vaxerski avatar Jul 17 '23 22:07 vaxerski

image it breaks. while v1's position works flawlessly

JustSimplyKyle avatar Jul 19 '23 02:07 JustSimplyKyle

why not use chromium with its much better text input protocol by using --gtk-version=4?

use --gtk-version=4 has wrong position of Candidate Box position.

By the way, this bug does not only occur in chromium , it also occurs in other electron applications like vscode, which not support the option `--gtk-versinon=4' that can only use tiv1 to input.

mxmf avatar Jul 19 '23 13:07 mxmf

When using gtk4, Chromium only creates an invisible dummy gtk window while rendering its real window using wayland APIs, hence the im panel need to calculate rendering position on its own. Usually the im module can get the input position relative to the window, but under wayland the impanel process cannot get the window position relative to the screen. This is not a problem in GNOME since the im panel and mutter share the same process.

~~We may need each im panel implementation to add some custom code to communicate with hyprland to get the current window position relative to the screen.~~ looks like this will not work since impanel position is passed from gtk4 to wayland compositor https://wayland-book.com/xdg-shell-in-depth/popups.html , and here gtk4 only has the dummy window hence no correct relative position from window to screen.

https://discourse.gnome.org/t/ime-client-widget-when-using-gtk4-and-or-wayland/8245 https://bugs.chromium.org/p/chromium/issues/detail?id=1265118

mxj4 avatar Aug 19 '23 01:08 mxj4

I also encountered this issue, and --gtk-version=4will cause crashe instantly.

@vaxerski any progress on this?

leonasdev avatar Aug 19 '23 09:08 leonasdev

On KDE, --enable-wayland-ime works perfectly with multiple chromium windows. Perhaps the issue could come from Hyprland's text-input-v1 implementation?

tianze0926 avatar Feb 04 '24 12:02 tianze0926

Thank you for resolving this issue! Now I can use chromium in wayland mode without letting my ime bork!

JustSimplyKyle avatar Mar 19 '24 16:03 JustSimplyKyle

Wow I didn't noticed this issue was resolved! Now I can install back hyprland and enjoy. Thank you!

leonasdev avatar Mar 19 '24 16:03 leonasdev

I've been typing in japanese forever on hyprland and never had any issues, lel, but cool yall can now too

vaxerski avatar Mar 19 '24 16:03 vaxerski

Then enjoy !

sujoshua avatar Mar 19 '24 18:03 sujoshua