Skip to content
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

Support of short term focus loss and avoid folding #1643

Closed
katoquro opened this issue Sep 7, 2019 · 8 comments
Closed

Support of short term focus loss and avoid folding #1643

katoquro opened this issue Sep 7, 2019 · 8 comments

Comments

@katoquro
Copy link
Contributor

katoquro commented Sep 7, 2019

Hello!

I had an issue with keyboard shortcuts and "Hide on lose focus" option. I'm using https://github.com/autokey/autokey and it always takes focus for very short period of time and then returns it back.
I've tried to implement a feature when there is a timeout for the window hiding and focus is checked after timeout. I'm not good at Guake technology stack so I decided make a proof of concept and see how it works. I'm using it for several months and didn't found any major issues.

The code can be found here
https://github.com/katoquro/guake/commit/87dcdbb7c6cd5d9f3376c50a7524471725d3a635
or the last commit at this branch https://github.com/katoquro/guake/commits/feature/short-term-focus-loss
I can create a pull request if some one knows how to pull this feature as flag into the settings

Looks like this feature can close these issues
#937
#687

@Davidy22
Copy link
Collaborator

Davidy22 commented Sep 5, 2021

You can create a pull request from your fork and we can take a look and help with getting it polished off for inclusion.

#1831 might be related too.

@Davidy22
Copy link
Collaborator

Alright, I've checked out and rebased your code and I can notice the small delay, but I haven't been able to observe whether or not this actually fixes the issue because my IME didn't steal focus in the first place, and I can't find a program that only swipes focus for a small moment. For adding items to preferences, I have some open pull requests that demonstrate adding an item to preferences that you can follow a similar path for.

@Davidy22
Copy link
Collaborator

Update after using this patch for a while, I realised that workspace switch also counts as a short focus grabbing event and while it was novel, I don't want guake to stick around when I switch workspaces. This may need functional reworking, also potentially this bug should be the responsibility of the IME developer since some IMEs (like mine, fcitx) are apparently able to function without taking focus and dropping you out of guake.

@katoquro
Copy link
Contributor Author

I've rebased and pushed my PoC to create PR.
@Davidy22 Could you explain a bit more about the behavior with workspaces? You mean guake terminal keep open in the new workspace after the switch but you want get it closed?

@Davidy22
Copy link
Collaborator

So, the option that's we're talking about here is the "Hide if lose focus" option. Ostensibly, people turn this on if they want guake to go away when they tab away to another program. Switching workspaces is basically tabbing away to another program, but the approach this patch takes stops guake from dismissing when we switch spaces. Ideally we want to do this in a way that still lets the temporary context switch when changing workspaces hide guake, but not an IME. Also as I noted before, not every IME seems to swipe focus and doing so might just be considerable as a bug on part of the IME.

@katoquro
Copy link
Contributor Author

"Hide if lose focus" it's current behavior and patch supposes that there should be one more (if the first is enabled) checkbox - "Ignore short focus loss" and number field (lets say in ms) for duration of "short loss" (plesesee this line e28c0d8#diff-be8a9fc8fe311afaa1cf2a8b932b3b371cd3ad3208c5dc0f2dd4695239d52bacR509). But if after the workspace switch the focus returns to the Guage automatically this property won't help. Kind of possible workaround ¯_(ツ)_/¯

@Davidy22
Copy link
Collaborator

Davidy22 commented Sep 11, 2021

Well, I'd probably rather have it as just its own checkbox instead of piggybacking another option.

@Davidy22
Copy link
Collaborator

PR merged, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants