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

Zed loses focus while dragging or resizing #16484

Open
1 task done
2zqa opened this issue Aug 19, 2024 · 9 comments
Open
1 task done

Zed loses focus while dragging or resizing #16484

2zqa opened this issue Aug 19, 2024 · 9 comments
Labels
bug [core label] linux linux-wayland Linux Wayland mouse interaction Feedback for mouse interaction states, actions, etc workspace Feedback for workspace management, layout, interactions, etc

Comments

@2zqa
Copy link

2zqa commented Aug 19, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When resizing or dragging (i.e. window manipulation) Zed, the window loses focus. It should retain focus while doing these operations.

Environment

Zed: v0.148.1 (Zed)
OS: Linux Wayland fedora 40
Memory: 31 GiB
Architecture: x86_64
GPU: Intel(R) Graphics (RPL-U) || Intel open-source Mesa driver || Mesa 24.1.4

If applicable, add mockups / screenshots to help explain present your vision of the feature

Schermopname.van.2024-08-19.19-56-17.mp4

If applicable, attach your Zed.log file to this issue.

No response

@2zqa 2zqa added admin read bug [core label] labels Aug 19, 2024
@2zqa 2zqa changed the title Editor loses focus on dragging Editor loses focus while dragging or resizing Aug 19, 2024
@2zqa 2zqa changed the title Editor loses focus while dragging or resizing Zed loses focus while dragging or resizing Aug 19, 2024
@JosephTLyons JosephTLyons added workspace Feedback for workspace management, layout, interactions, etc linux linux-wayland Linux Wayland mouse interaction Feedback for mouse interaction states, actions, etc and removed triage labels Aug 23, 2024
@ajstarks
Copy link

ajstarks commented Sep 1, 2024

Reproducible with Zed 0.150.4, Fedora 40, Wayland, Intel HD Graphics 520.
Note that opening another app fixes the issue.

@apricotbucket28
Copy link
Contributor

I guess that Gnome sends a keyboard leave event when dragging or resizing, but I'm not sure how other programs/toolkits handle this.

GPUI starts a window move here, and it uses the mouse serial. And the xdg_toplevel::move docs state:

If triggered, the surface will lose the focus of the device (wl_pointer, wl_touch, etc) used for the move.

So it does not really make sense to lose keyboard focus as well.

@2zqa
Copy link
Author

2zqa commented Sep 1, 2024

Note that opening another app fixes the issue.

@ajstarks, what do you mean with this? Could you perhaps create a screencast of this behavior? I cannot reproduce this. Tested with Firefox as a secondary app.

but I'm not sure how other programs/toolkits handle this.

@apricotbucket28 As far as my experience goes, Zed is the only one that does this. Electron apps (like Spotify), native GTK4/libadwaita apps (like the file manager Nautilus) and apps without toolkit (like Blender, although I am not 100% sure if it uses absolutely no gtk)

@apricotbucket28
Copy link
Contributor

As far as my experience goes, Zed is the only one that does this. Electron apps (like Spotify), native GTK4/libadwaita apps (like the file manager Nautilus) and apps without toolkit (like Blender, although I am not 100% sure if it uses absolutely no gtk)

I mean like how they handle window focus and decide whether to show the inactive or active title bar color. From the Wayland docs, it does not seem like keyboard focus should be lost when dragging the window. And this issue does not happen on KDE either 😕

@ajstarks
Copy link

ajstarks commented Sep 2, 2024

Here is a screen cast: the first seconds, you cannot get focus, when I open Chrome, I can. (To reiterate: this is Linux 6.10.6, Fedora 40, Gnome 46, Intel HD Graphics 520) One more data point: I do not see this behavior on my AMD system with the same Desktop Environment

Screencast.from.2024-09-02.15-24-26.mp4

@2zqa
Copy link
Author

2zqa commented Sep 2, 2024

I don't quite understand your recording. You only moved Zeds window when the secondary program was open. During that window movement, the issue was reproduced: the window lost focus (the taskbar turned transparent; this bug was fixed in #16833). If I understand correctly and you can't unfocus the window unless there is another app open: that should be intended behavior. (Except when moving or resizing the window, that's what this ticket is about)

@ajstarks
Copy link

ajstarks commented Sep 2, 2024 via email

@2zqa
Copy link
Author

2zqa commented Sep 3, 2024

That seems to be a separate bug right? Please report as such!

@ajstarks
Copy link

ajstarks commented Sep 3, 2024

Reported as #17332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] linux linux-wayland Linux Wayland mouse interaction Feedback for mouse interaction states, actions, etc workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
Development

No branches or pull requests

5 participants