-
Notifications
You must be signed in to change notification settings - Fork 612
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
input method #1735
input method #1735
Conversation
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.
Not an IM expert, but a few remarks across the board
Looks good from here, with some tweaks it’ll be mergeable in my book
related libgwater PR sardemff7/libgwater#4 |
fixed the event forwarding, we only forward the event if we have a xim server in place (when xcb->ic is created), so typing works without an xim server. added a disconnection callback too, so if the xim server is down, we properly revert to not forwarding events. both warnings are related to event type 31 (XCB_SELECTION_NOTIFY), for some reason we receive one as soon as we get to the x11 main loop, and rofi returns a XIM server window position is slightly off, the position can be offsetted changing the |
Ugh, my brain is foggy. I already do this (for the mouse handling). We just need to recurse back to sum up all relative positions. Do you need position relative to rofi window or absolute position? There is a |
As noted in sardemff7/libgwater#4 the |
I wanted to say:
|
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’re getting closer!
how can I get the text width? the IM window is already at the correct height for most widgets ([thanks @DaveDavenport), but now I need the current text width so the window follows the text. |
That is currently not stored. I will try to add a function that gets the cursor position (I think this is what we want). |
xim context creation was moved to rofi, a little easier to test now |
sorry for the next two commits, forgot to unstage the changes |
I've added a get_cursor_x_pos method to textbox
|
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.
Although it’s some hard-to-read code (as any code related to input, apparently), I’m good with this version on the plumbing side 🙂
Guess it just need some polishing on the UI side
I’ll let @DaveDavenport handle the rest 😄 (but don’t hesitate to ping again if needed)
tried the new get_cursor_x_pos() and everything's almost working, the problem I found is that get_cursor_x_pos() is returning the cached cursor_pos which is calculated on the previous draw, so just placing the update on rofi_view_handle_text() doesn't work, where should I put the window position update? |
actually I think the expected behaviour is for the window to follow as you type, before commiting the text. Think I can do that through the callbacks, but that will complicate some things, I would need to preview typed text without actually triggering the fuzzy finder, we might want to do that later, on another PR. |
the new position is available once drawn.. So after 'widget_draw' so in rofi_view_update |
hello, I won't be able to work on this for a few days, couldn't make the preedit callbacks work, but aside from this small problem, it's quite ready, feel free to finish or just hack for now. The problem is that if you're typing normal character (not composing a character, like with japanese), typing really fast is slightly less responsive because of |
I noticed that with fcitx running, esp the first character takes very long to appear on my test machine. (i5-6500t, 8gb ddr4, nvme disk, not fast, but not a slow machine either). |
This doesn't happen on my machine, are you on fcitx5 (latest version)? also, when you're using an input method, it sometimes messes your autorepeat (xset r rate) when changing between servers, try running |
Installed the fcitx5 (deb) on my pop-os test machine. Its up2date but no idea what version. |
@sardemff7 is that 'changes requested' still open or can this be merged? |
Users report (and shown) extreme slowdown by this patch making rofi near unusable. I will revert unless we can find a solution. |
revert this for now, tested yersterday under heavy load and it's quite unusuable indeed. There's something wrong with the event forwarding, sometime the keys are swalloed without the string being commited, only to both be commited once the next event is forwarded. This becomes apparent if the code cant run fast enough, which is caused by the window position being updated every draw as I've noted before, we're paying to much round-trip with the server. Ideally this shouldn't happen, even under heavy loads, this pr requires some more careful handling with the server (only communicate when necessary, throttling, etc.), I'll try to fix when I get the time again, or someone with more knowledge can step in. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
input method draft, it works, but it was hacked together since I'm not familiar with rofi's code base, nor an ime expert
We just create an XIM handler with a new dependency
xcb-imdkit
, and forward each PRESS event to it.only tested with fcitx5.