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

focus-follows-mouse breaks goto_splits actions #3229

Closed
bvergnaud opened this issue Dec 27, 2024 · 2 comments · Fixed by #3997
Closed

focus-follows-mouse breaks goto_splits actions #3229

bvergnaud opened this issue Dec 27, 2024 · 2 comments · Fixed by #3997
Labels
contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux
Milestone

Comments

@bvergnaud
Copy link

Hello,

Congrats on public release.

Trying the terminal tonight on Linux, I noticed that if I set focus-follows-mouse = true, goto_split keybinds only flicker to the target split, and immediately return to the split my mouse is hovering.

In similar situations, all the tiling tools I know about behave in one of two ways:

  • Switch focus as requested but return to the hovered split as soon as the mouse moves.
  • Switch focus as requested, and keep it there until mouse crosses over a boundary.

It could also be left to the user to decide, as a config option.
There could also be a smarter way to deal with this that I don't know about, of course.

This is repeatable on Arch Linux with the extra/ghostty 1.0.0-2 package.

> ghostty --version
Ghostty 1.0.0-dev+0000000

Version
  - version: 1.0.0-dev+0000000
  - channel: tip
Build Config
  - Zig version: 0.13.0
  - build mode : builtin.OptimizeMode.ReleaseFast
  - app runtime: apprt.Runtime.gtk
  - font engine: font.main.Backend.fontconfig_freetype
  - renderer   : renderer.OpenGL
  - libxev     : main.Backend.io_uring
  - GTK version:
    build      : 4.16.7
    runtime    : 4.16.7
  - libadwaita : enabled
    build      : 1.6.2
    runtime    : 1.6.2
@mitchellh mitchellh added os/linux gui GUI or app issue regardless of platform (i.e. Swift, GTK) labels Dec 27, 2024
@mitchellh
Copy link
Contributor

I haven't confirmed it but I can believe this on first read.

I've confirmed this is not an issue on macOS. I suspect this is GTK apprt specific.

@mitchellh mitchellh added the contributor friendly A well-scoped, approachable issue for someone looking to contributor. label Dec 27, 2024
@jnichols0
Copy link
Contributor

jnichols0 commented Dec 30, 2024

I reproduced this on Linux and found that applying the suggested patch mentioned here #3345 (comment) fixes it. I am thinking this is another symptom of setting the window title creating a mouse motion event.

mitchellh added a commit that referenced this issue Jan 2, 2025
Fixes #3229


Gets the desired behavior for #3229, I'm unsure if there is a nicer way
to omit the mouse motion events from the event controller
when the glarea is resized due to the splitting behavior. Thresholding
to 1px is required because just checking for equality results
in the focus still being stolen sometimes. This is kinda of a hack so a
nicer solution would be much appreciated!
@mitchellh mitchellh added this to the 1.0.2 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly A well-scoped, approachable issue for someone looking to contributor. gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants