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

fix: close preview window after focus completed #2436

Closed
wants to merge 1 commit into from

Conversation

decodism
Copy link
Contributor

Tries to fix #2432. I'm not sure if the 50ms delay is enough. I tried waiting for kAXFocusedWindowChangedNotification but there was still flickering and it was more complicated.

src/ui/App.swift Outdated
Comment on lines 211 to 213
window.focus() {
Windows.previewFocusedWindowIfNeeded()
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter is only passed here, right? Perhaps the method could host it, if it has only 1 possible value, don't you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lwouis
Copy link
Owner

lwouis commented Mar 30, 2023

Thanks for working on this improvement @decodism.

Of course, waiting 50ms is not going to work in some cases. Maybe it will avoid 80% of flickers though.

I'm really curious what the HyperSwitch implementation does. It's very smooth.

@decodism
Copy link
Contributor Author

I tried HyperSwitch and it just seems to use a fade out animation. I find that there is still flickering even if less pronounced.

@lwouis
Copy link
Owner

lwouis commented Mar 31, 2023

Maybe we could add a fadeout aimation too then if it helps smoothen the switch?

@decodism
Copy link
Contributor Author

decodism commented Apr 2, 2023

I think what helps is the extended closing time and not the animation itself.

@lwouis
Copy link
Owner

lwouis commented Jun 23, 2023

@decodism I played with it, and I still get flickers sometimes. It's rare though, so I'll merge this as it's clearly an improvement 👍

Thank you

@lwouis lwouis force-pushed the master branch 2 times, most recently from 796a3c3 to a67d123 Compare June 23, 2023 21:31
@lwouis
Copy link
Owner

lwouis commented Jun 23, 2023

The content of this PR have been cherry-picked onto the master branch, and the latest release of AltTab ships with it.

Thank you for your contribution 🙇

@lwouis lwouis closed this Jun 23, 2023
@decodism
Copy link
Contributor Author

@lwouis If you are still experiencing flickering, it might be worth increasing the delay.

@decodism decodism deleted the master-3 branch August 11, 2023 11:56
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

Successfully merging this pull request may close these issues.

Preview option can create screen flickering when switching windows
2 participants