-
Notifications
You must be signed in to change notification settings - Fork 103
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
Workaround OSK issues on electron #3681
base: main
Are you sure you want to change the base?
Conversation
e71226b
to
ec03b88
Compare
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.
I'm unclear why we need both an optional pending_state
and a pending_state_used
. I realise that pending_state_used == pending_state
isn't an invariant as proposed, but it is too close to being one for me to be convinced we need both.
Looking through the code, it looks as though pending_state
should be set if and only if we are between activate()
and deactivate()
transitions.
As you have noted the reset()
method breaks the state machine by resetting
pending_state_used
regardless of activate()
and deactivate()
transitions.
I think reset()
behaving badly is the immediate cause of the other problems.
The root cause, of course, is that using pending_state.is_set()
to track the activate()
and deactivate()
transitions is cryptic at best.
In summary, I think pending_state_used
and the other changes proposed are unnecessary, but that both reset()
and commit_state()
should be resetting the value stored in pending_state
(n.b. not the optional itself)
Just as Alan suggested, going with |
So rather than popping up, and hiding, the numerical keyboard, we'd pop up the standard keyboard? Discarding the input field type? Was Mir doing something wrong wrt. to the protocol? If not, I don't think we should be breaking that. If the OSK is reacting badly to us using the protocol correctly, that's something to fix in Squeekboard, IMO. |
I think it's more of the client (electron) misbehaving. We get a |
Ah, but a well behaved client will still get the full monty. WFM! |
Any examples of such client? Just for testing purposes |
I've only actually seen browsers choose the field format, so trying in different browsers (e.g. https://snapcraft.io/wpe-webkit-mir-kiosk), provided they actually support the input method protocol… |
Ok, so I just tested the demo URL in the original issue on both electron and wpe-webkit. With no changes to workaround the bug, wpe doesn't seem to exhibit this bug. |
ec03b88
to
721404a
Compare
You mean with WPE and ubuntu-frame-osk, this PR is not needed and everything behaves fine? So the issue is in Electron? Can you check Chromium out as well? |
It seems so, yes. I think this is mainly because WPE webkit uses
Chromium 133.0.6875.0 unstable. Without the fix applied, the "Interval" field in the Ignition demo shows the exact same behavior as in Electron, the number field in W3shool's example thingy works fine |
And Electron / Chromium misuse the And how does the |
Exactly!
According to wayland.emersion.fr:
So yeah, we're still good. |
It occurred to me that it still isn't quite right. If we receive a |
Guess what. It's undefined.
It's an empty pending state, so does it matter? |
The code is confusing: instead of having active/inactive states, or even an |
Closes #3580.
I haven't wrapped my head around how everything connects together regarding how we manage the OSK and its state. So consider this PR as set of workarounds/shims until then.
Fixes a few issues:
The "Interval" field showing the OSK for a split second
This was because
commit_state
was called before any other code had the chance to setpending_state
, which caused the input handler to be disabled, hiding the OSK.The "Interval" field (and similar fields) didn't get input changes as you used the OSK
This was due to
text_changed
requiringpending_state
to be set, despite not using it. And taking into account the possible mismanagement/client misbehavior clearingpending_state
, this caused changes to not go through.Tabbing from the interval field to the minutes/hours/days field to its right opened the OSK in number mode.
This was due to
reset
being called between the content type being set in the state and the state being actually committed, causing Mir to lose the state and not commit it to the handler, leading to the previous mode (numbers) carrying over to the new field.Some things I've noticed while working:
miral-kiosk
, the client crashes after the OSK shows up for one frame.miral-app
was used for testing and debugging so far. This wasn't the case when I originally worked on this issue. I tried going back to v2.17.0 and it still occurs there.