Skip to content

text_input: Implement input-method popups#7226

Merged
emersion merged 22 commits intoswaywm:masterfrom
Decodetalkers:input-method-popups
Feb 20, 2024
Merged

text_input: Implement input-method popups#7226
emersion merged 22 commits intoswaywm:masterfrom
Decodetalkers:input-method-popups

Conversation

@Decodetalkers
Copy link
Copy Markdown
Contributor

@Decodetalkers Decodetalkers commented Oct 17, 2022

May I continue this pr in #5890 ?

@q234rty
Copy link
Copy Markdown

q234rty commented Oct 27, 2022

I'm not sure but I don't think this currently works at all? i.e. the original PR needs changes after https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3660 .

@Decodetalkers
Copy link
Copy Markdown
Contributor Author

I'm not sure but I don't think this currently works at all? i.e. the original PR needs changes after https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3660 .

image

Emm, It seems still works with the wlroots master and sway master, and I also make changes with the suggestion of the maintainer..

@q234rty
Copy link
Copy Markdown

q234rty commented Oct 28, 2022

@Decodetalkers Does the input popup correctly disappear after you commit some text?

@Decodetalkers
Copy link
Copy Markdown
Contributor Author

@Decodetalkers Does the input popup correctly disappear after you commit some text?

I cannot understand, what kind of "uncorrect", can you show me a video ? I cannot reproduce anything..

@q234rty
Copy link
Copy Markdown

q234rty commented Oct 28, 2022

mov-2022-10-28--17-05-11.mp4

@Decodetalkers
Copy link
Copy Markdown
Contributor Author

mov-2022-10-28--17-05-11.mp4

I see, I reproduced it on foot.. but wezterm do not have such problem.. Interesting..

@Decodetalkers
Copy link
Copy Markdown
Contributor Author

mov-2022-10-28--17-05-11.mp4

Now it should be fixed

@amano-kenji
Copy link
Copy Markdown

Does this show horizontal pop-ups or vertical pop-ups?

@q234rty
Copy link
Copy Markdown

q234rty commented Jan 30, 2023

Does this show horizontal pop-ups or vertical pop-ups?

@amano-kenji This depends on your IME. The popup is rendered by the IME.

@amano-kenji
Copy link
Copy Markdown

Is it going to be merged soon? It sems Hyprland already merged this feature.

@cherrot

This comment was marked as off-topic.

@bl4ckb0ne
Copy link
Copy Markdown
Contributor

@cherrot open a new issue for this

@tokyo4j
Copy link
Copy Markdown

tokyo4j commented Feb 19, 2024

I found the position of popups is shifted by the offset requested with xdg_surface.set_window_geometry in Firefox. So I guess the position should be subtracted by that offset.

20240206_00h26m13s_grim

Maybe my comment here is missed.
Same problem happens when I run GTK_IM_MODULE=wayland gedit (I set GTK_IM_MODULE to ensure GTK doesn't use dbus interface).

I found this problem is not present in sway-im AUR where scene-graph API is not adopted yet.
I'm not familiar with sway codebase, but I guess this is because the position of surface node can be different from that of the view node.
For reference, wlroots sets the offset of surface node here.

@Decodetalkers
Copy link
Copy Markdown
Contributor Author

I found the position of popups is shifted by the offset requested with xdg_surface.set_window_geometry in Firefox. So I guess the position should be subtracted by that offset.
20240206_00h26m13s_grim

Maybe my comment here is missed. Same problem happens when I run GTK_IM_MODULE=wayland gedit (I set GTK_IM_MODULE to ensure GTK doesn't use dbus interface).

I found this problem is not present in sway-im AUR where scene-graph API is not adopted yet. I'm not familiar with sway codebase, but I guess this is because the position of surface node can be different from that of the view node. For reference, wlroots sets the offset of surface node here.

ok, thanks

struct sway_input_popup *popup;
wl_list_for_each(popup, &relay->input_popups, link) {
// send_text_input_rectangle is called in this function
input_popup_update(popup);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input_popup_update() is a pretty big hammer, it means we'll create/destroy scene nodes every time a keypress is made. But let's keep this as-is for now and leave the optimization for later.

@emersion
Copy link
Copy Markdown
Member

Alright, I think this is the last round of comments from me!

remove useless line, and code style adjust
@Decodetalkers
Copy link
Copy Markdown
Contributor Author

Alright, I think this is the last round of comments from me!

Thanks, I have finished it

Copy link
Copy Markdown
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, let's go with this then, thanks a lot for your hard work! I think many users will be thankful :P

@eternal-sorrow
Copy link
Copy Markdown

So, will there be a release anytime soon that includes this? Because the patch was reworked on top of the new rendering system and the new rendering system is not included in the 1.9 release, there is no way currently to have popups on sway 1.9. So I'm stuck with sway 1.8.1 and an old version of this patch.

@kennylevinsen
Copy link
Copy Markdown
Member

Non-bugfix sway releases follow wlroots releases.

If you need features newer than the latest release, you can always build sway and wlroots master. There's even recipes and packages for some distros by community members (AUR, Copr, debian/ubuntu repos, etc.).

@eternal-sorrow
Copy link
Copy Markdown

So no? Okay then...

@GalaxySnail
Copy link
Copy Markdown

There is a patch for sway 1.9 on AUR: https://aur.archlinux.org/packages/sway-im, extracted from commit 0789c12a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.