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

Navigation between X windows is surprising #279

Open
jruere opened this issue Jan 8, 2025 · 4 comments
Open

Navigation between X windows is surprising #279

jruere opened this issue Jan 8, 2025 · 4 comments

Comments

@jruere
Copy link

jruere commented Jan 8, 2025

Hi! Thanks for this excellent improvement over Neovim!

The feature which caught my attention was the ability to move a vi window into an X window while still being part of the same session. Have been wanting to handle vi and X windows in a single way for a while!

Nevertheless, I encounter a very surprising behaviour. When a vi window is moved into an X window, I can navigate between them using the window manager (WM), but when I try to use the focused window, focus jumps to the one where vi would be "focused". Does this explanation make sense?

I'll give you an example.

  1. Start fvim on file 1.
  2. :sp file 2. Now there are two vi windows visible in one X window, and the vi focus is on file 2.
  3. Ctrl-w ge. Now there are two X windows, each with one vi window.
  4. With the WM, change focus to the X window which has file 1.
  5. When I type, I'd expect that input goes to file 1, but X window focus jumps to the X window with file 2, where the vi focus was.

Another thing I found surprising was that pressing Ctrl-ww changes the X window focus. I'd have expected for focus to switch between the windows within an X window, not among them.

Is this the intended behaviour?

@jruere jruere changed the title Navigation between X windows doesn't really work Navigation between X windows is surprising Jan 8, 2025
@yatli
Copy link
Owner

yatli commented Feb 15, 2025

Hi! I think this is kinda expected behavior, because activating the "X window" does not activate the corresponding vi window (if so, which vi window shall I activate?).

I vaguely remember that fvim will send a focus grab request when switching between multiple grids. If I understand correctly, you want the other way around? That is, send multigrid focus switching when X window focus has changed.

The idea of X window embedding is interesting. We may assemble an IDE-ish environment with this capability :)

@jruere
Copy link
Author

jruere commented Feb 15, 2025

Hi! I think this is kinda expected behavior, because activating the "X window" does not activate the corresponding vi window (if so, which vi window shall I activate?).

Whichever was active on that X window. Would this not be the expected behaviour for any application? The focus stays where it was.

I vaguely remember that fvim will send a focus grab request when switching between multiple grids. If I understand correctly, you want the other way around? That is, send multigrid focus switching when X window focus has changed.

I don't understand what you are saying. Sorry.

The idea of X window embedding is interesting. We may assemble an IDE-ish environment with this capability :)

I don't understand how this would be X window embedding. I had not considered this.
Currently, there are two "window managers" at play. Regular vim has only its thing but outside vim, there's always one more.
I guess it would be possible to never use vim's WM, and just use X windows for windows. This means that only X's WM could be used to switch between windows. I like it, but I think most vim users would find that jarring.

@yatli
Copy link
Owner

yatli commented Feb 16, 2025

Whichever was active on that X window.

What if there are multiple? Do I keep track of them?

@jruere
Copy link
Author

jruere commented Feb 17, 2025

Whichever was active on that X window.

What if there are multiple? Do I keep track of them?

I'd assume so.

Please, consider if this is something that makes sense. It could be that vim users just don't work like this.

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