-
Notifications
You must be signed in to change notification settings - Fork 104
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
Disable token creation for a bit on keyboard input #3727
Disable token creation for a bit on keyboard input #3727
Conversation
All this within the terminal?
That's wrong. Pluma is not focused, it can't get a valid token. There's just no world where that makes sense 🤷. It would mean apps in background could activate themselves completely on their own. Why tokens, then? I don't think this PR makes sense, typing in the terminal post |
Yes
Yes, but when you actually discovered the bug, the code to check if the application/session requesting the token was different from the focused one didn't exist on the branch you were building from.
The bug isn't related to who is asking for the token, it's related to when. The whole roundtrip happens between key presses. So we don't have a chance to invalidate tokens. |
…-activation-doesnt-invalidate-tokens-on-keyboard-input
I too don't understand what this is supposed to address:
None of that has to with when the request happens |
OK so what you're saying is that when the TBH feels to me like the whole |
Oh, so is it the terminal that requests the token? I guess the meaningful key event for |
Not a bug, feature :) |
Fixes apps being activated even while typing.
To test:
pluma &
sleep 2 && pluma
Without this fix, pluma manages to request an activation token and request activation with this token between keystrokes. This PR adds a small window (100 ms) after each keystroke where token creation is disabled.
Note: To properly test, the session check here should be removed. We're still discussing whether this check should be included or not as it doesn't make sense for unfocused applications to be able to request tokens and activate themselves, but we haven't seen any applications that behave as expected so far.