qtile / qtile

:cookie: A full-featured, hackable tiling window manager written and configured in Python (X11 + Wayland)
http://qtile.org
MIT License
4.82k stars 702 forks source link

prompt widget closes on window spawn #5089

Open 3hhh opened 2 hours ago

3hhh commented 2 hours ago

Issue description

If a window spawns while one is entering a command inside the prompt widget, the window apparently steals the focus, closes the prompt and the command may go to the new window (if one is still typing). This is rather annoying and may also leak information to windows (imagine a web page window) for which it's not supposed.

I suppose the same may happen for other widgets, too, but I haven't verified that.

Version

0.29.0

Backend

X11 (default)

Config

https://github.com/3hhh/qubes-qtile

Logs

No response

Required

tych0 commented 2 hours ago

Yeah, I have noticed this too. I personally have focus_on_window_activation = "never" and it still does it, maybe it shouldn't in this case? But in the other cases (e.g. "smart"), I think it is still reasonable to focus the default window? Not sure, I could be convinced otherwise.

3hhh commented 1 hour ago

I doubt that the window actually requested focus; that's probably why focus_on_window_activation has no effect in this case.

It's however weird that this behaviour even bypasses window.can_steal_focus(), which I overwrite. I'd vote to at least respect that function.

I'm not 100% sure about other default behaviour changes as it may have to be decided per widget type: A widget designed to open windows may want to pass focus to these windows; the prompt widget may usually never want to pass focus. A per-widget setting may be ideal, but probably also a lot of code...

tych0 commented 1 hour ago

oh, yeah, can_steal_focus() is nice; then people could do the same thing you are, or check if the prompt widget is open or whatever.