-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement input_method_v2 popups #5890
Conversation
95af575
to
e399a4c
Compare
b94a50b
to
7478170
Compare
36357ee
to
ce391ee
Compare
sway crash on exit
another crash
|
381e7e0
to
fdaf0db
Compare
03d8ee8
to
987d8dc
Compare
987d8dc
to
227d34d
Compare
#4932 has been merged now, so this needs a rebase. |
227d34d
to
4edc70f
Compare
I apply this PR with the current HEAD. |
I've tested it with AUR package sway-im with fcitx5 as input method in kitty. When the character meets the end of a line, the popup will be hidden. I don't know if it is a issue with kitty. Alacritty won't meet this issue since it won't put characters into the line before I select my needed word in IM. |
Now I test it ( after fixing the output_box api problem) with the HEAD of fcitx5 and HEAD of sway, everything works! |
@emersion Looks like this is ready for another review :) |
9debeb4
to
100ac12
Compare
@@ -395,6 +395,8 @@ static bool surface_is_popup(struct wlr_surface *surface) { | |||
wlr_subsurface_from_wlr_surface(surface); | |||
surface = subsurface->parent; | |||
} | |||
if (wlr_surface_is_input_popup_surface_v2(surface)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: braces are mandatory
@@ -139,6 +161,11 @@ struct sway_node *node_at_coords( | |||
return NULL; | |||
} | |||
|
|||
if ((*surface = input_popup_surface_at(output, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably move this up right before "check for unmanaged views" to allow fullscreen surfaces to work with IMEs.
continue; | ||
} | ||
double _sx = ox - lx; | ||
double _sy = oy - ly; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mixes up layout-local coords and output-local coords. I think input_popup_surface_at
should take layout-local coords instead.
wl_signal_add(&view->events.unmap, &popup->focused_surface_unmap); | ||
|
||
// Since the focus has changed, the popup may have to adjust | ||
update_popup: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a goto
, else if
/else
would be more readable.
|
||
struct sway_view *view = view_from_wlr_surface( | ||
text_input->input->focused_surface); | ||
if (view->container == NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can return NULL here.
This logic doesn't work on subsurfaces nor xdg_popups.
@tadeokondrak @emersion This PR seems to have some amendments pending. Can I take over by starting another PR? |
Based on swaywm/sway#5890 Co-authored-by: Leonardo Hernández Hernández <[email protected]>
Someone has been testing this with SDL and it seems there's an issue with fcitx, but only when integer scaling is used...? We have some ideas on our end, but figured we'd include the issue here in case it's something obvious on the compositor side of things. |
Sorry about this PR... I've left it open because I thought I could get to it eventually - but it looks like someone else is continuing the effort at #7226, which is great. |
Thanks that you have return back..Your help is still needed..Do you still have time now? |
I do not know how to make change about this request, can you help me? |
Depends on
#4932,swaywm/wlroots#2550andhttps://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3416.swaywm/wlroots#2697,#5980,#6004, and#6005are related but not required.