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: prevent focus gained/lost loop on wayland #117

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

folke
Copy link
Contributor

@folke folke commented Jun 18, 2023

On wayland, when getting the contents of the system clipboard with wl-paste, wl-paste is launched.
wl-paste gets the window focus, so NEovim FocusLost is triggered.
This triggers an endless loop of focus lost/gained.

This PR fixes that.

Fixes #37

Verified

This commit was signed with the committer’s verified signature.
folke Folke Lemaitre
@gbprod
Copy link
Owner

gbprod commented Jun 18, 2023

Thanks for this PR ! I can't confirm it works but it seems ok!

I'm waiting for some feedback and I'll merge later.

@gbprod
Copy link
Owner

gbprod commented Jun 21, 2023

Even if we don't have feedback, I think we can merge this PR. What do you think @folke ?

ping @anuvyklack @ray-x @bezmi @lalitmeeq

@lalitmeeq
Copy link

It seems like it's working fine. @gbprod and @folke

@folke
Copy link
Contributor Author

folke commented Jun 21, 2023

I use Hyprland and didn't have the issue there, probably because wl-paste doesn't get focus there when starting.

If you would like to trigger the original issue, open Neovim in Kitty, on Gnome (with wayland) using wl-clipboard.

That would create an endless loop and makes Neovim unresponsive.

The fix in this PR is to make sure that loop no longer happens.

Should be safe to merge as is. I can't think of any situation where that kind of behavior would be wanted with the other clipboard handlers.

@gbprod
Copy link
Owner

gbprod commented Jun 21, 2023

Thanks !

@gbprod gbprod merged commit b125613 into gbprod:main Jun 21, 2023
@gbprod gbprod mentioned this pull request Sep 28, 2023
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.

Hangs Neovim
3 participants