Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mxmf opened this issue Jul 14, 2023 · 10 comments
Closed

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

mxmf opened this issue Jul 14, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@mxmf
Copy link

mxmf commented Jul 14, 2023

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 [WIP] text-input-v1 support #1778 .
test.mp4
@mxmf mxmf added the bug Something isn't working label Jul 14, 2023
@vaxerski
Copy link
Member

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

@JustSimplyKyle
Copy link
Contributor

image
it breaks.
while v1's position works flawlessly

@mxmf
Copy link
Author

mxmf commented Jul 19, 2023

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.

@mxj4
Copy link

mxj4 commented Aug 19, 2023

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

@leonasdev
Copy link

leonasdev commented Aug 19, 2023

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

@vaxerski any progress on this?

@tianze0926
Copy link

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

sujoshua added a commit to sujoshua/Hyprland that referenced this issue Mar 17, 2024
…ementation and imporve InputMethodRelay logic

fixes hyprwm#2708
sujoshua added a commit to sujoshua/Hyprland that referenced this issue Mar 18, 2024
…ementation and imporve InputMethodRelay logic

fixes hyprwm#2708
sujoshua added a commit to sujoshua/Hyprland that referenced this issue Mar 19, 2024
…ementation and imporve InputMethodRelay logic

fixes hyprwm#2708
vaxerski pushed a commit to sujoshua/Hyprland that referenced this issue Mar 19, 2024
@JustSimplyKyle
Copy link
Contributor

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

@leonasdev
Copy link

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

@vaxerski
Copy link
Member

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

@sujoshua
Copy link
Contributor

Then enjoy !

lisuke pushed a commit to lisuke/Hyprland that referenced this issue Apr 15, 2024
* input: Handling multiple surfaces for the text-input-v1 protocol implementation and imporve InputMethodRelay logic

fixes hyprwm#2708

* clang-format

* minor style nits

---------

Co-authored-by: Vaxry <vaxry@vaxry.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants