-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Godot steals focus on Xfce 4 #74378
Comments
CC @bruvzg |
related? #74587 (comment) |
I've naively removed all XSetInputFocus calls from 4.0-stable and it solves the problem for me for the time being (seeing this issue in XMonad ). It seems like sometimes XSetInputFocus is getting called inappropriately i.e. when another application has focus. I'm not an X11 programmer but my guess is Godot is getting faked out by tiling window manager abilities like resizing a window without focusing on it. e.g. Similar behavior happens if I swap the terminal and Godot while keeping focus on the terminal. Godot incorrectly interprets window re-positioning as a focus request. I've also seen similar behavior in LXDE, LXQT, and XFCE where Godot immediately steals back focus after leaving Godot via alt-tab (this is random and only occurs ~1/20 times). Though my guess is this is a similar but different code path than the tiling issues since this is random while the tiling issues seem to be deterministic with clear causes (moving, resizing). However, random occurrences of focus stealing (unrelated to move/resize) I've seen in XMonad may be the same as the alt-tab issue in the other WMs |
Also seeing focus stealing in i3. I have Godot and VS Code in a tiled setup side by side, but whenever I resize the focused VS Code window (using keyboard or mouse), Godot gets focused. |
You can see some issues with focus in PaperWM in the mentioned issue up there. Additionally, godot pretty much doesnt let me focus anything else in qtile. Definitely some weird stuff going on. EDIT: minor updates. |
Qtile user here. same issues. also facing an additional issue since godot 4.1 |
Possibly related issue I found when testing #80036 for regressions. On XFCE, the minimized state of a window goes out of sync when changing workspaces. Minimize a dialog, switch to alternate workspace, switch back, and the dialog becomes visible again. And yet, based on the XFCE pager, the icon for the window is still greyed out, indicating it is minimized. There are probably some edge cases with X11 window mapping / unmapping that the Godot display server isn't responding to appropriately. |
Just to chime in that I have had the same issue, on 4.1.1 now. I am using PaperWM with gnome (another tiling wm!) and Godot will just start stealing focus from any other app so I can't access them. The only way I can escape is to minimize Godot, which allows selecting other windows. Would love to help get this fixed but don't know where I would start. Is there any more helpful info I can provide? |
@Mequam - I have built a version of Godot 4.1.1 for my own use using your patch and so far i can report that it fixes the issue for me too (using PaperWM on Gnome) |
I would love to make a pull request if the code I added seems like it's ok,
the main reason I waited earlier was to make sure I wasn't the only one
with the problem (looks like im not).
The biggest thing I would be worried about with pull requesting it would be
the quality of my patches, i'm not super familiar with the X api that the
engine was using and one of the biggest things that I was worried about is
that my changes are either sub optimal for code organization, or that they
could induce further bugs into the engine that I would be unaware of.
I would be more than happy to submit a pull request if I was sure that
1) my changes were high quality enough to actually be in the engine and
2) they do not induce additional bugs (im particularly worried about the
engine not grabbing focus when it should)
3) this is a wide(enough) spread problem (appears to be the case :D)
if you want to help I would LOVE to have someone else look over the changes
that I made and double check that their not gonna do anything crazy or
wonky, I also (maybe?) vaguely remember thinking of a better way to
implement this solution , but it's been so long since i've worked on this I
can't remember if I implemented it or (perhaps more frustratingly) what
that solution was.
I will prolly attempt to do a quick review of all the changes I made before
making a pull request myself, but if anyone wants to help out and speed run
that process it'll be a while before I can get to that with the school
semester starting.
If anyone does want to help by reviewing my changes, please be BRUTAL with
me, I want the code that goes in to be good and am suspect that there might
be a better way to do this :D.
anyways
tl;dr
I will submit a pull request with the changes that we think work for at
least two people after either I double check the code and green light it or
can get an ok from someone else.
…On Sat, Sep 9, 2023 at 7:10 PM Anthony Finch ***@***.***> wrote:
@Mequam <https://github.com/Mequam> - I have built a version of Godot
4.1.1 for my own use using your patch and so far i can report that it fixes
the issue for me too (using PaperWM on Gnome)
Are you planning on raising a PR? Anything I can do to help?
—
Reply to this email directly, view it on GitHub
<#74378 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL2DXUEOYW6X4G2IIFRTBOTXZTZP5ANCNFSM6AAAAAAVPWFW2Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@Mequam I'm happy to take a nosier look at your changes and offer any opinions if I have any. I am also not an X11 api expert however! |
I think you can open a PR right away and we can discuss the solution there. This is better than risking the code eventually being forgotten in this issue. |
Hey @Mequam thanks for the fix! I've also tested it and my issues with my tiling window manager are resolved as well #80170. Not knowing much about the code, the most I can comment is it would be more aligned with the rest of the file if you called your function
instead of
Any chance you could submit a pull request? I am sure actually knowledgable people will comment and review your changes that way. In case you don't have the time to deal with this then let me know and I'll submit it for you. |
I have the same issue on Gnome (tested both X11 and Wayland), both when using the Forge WM, and when Forge is disabled. I think on losing focus, Gnome shakes the windows, and it makes Godot freak out. I have no idea if or how you can disable the shaking |
@unlessgames if you would be willing to submit this as a pull request that would be awesome! |
@unlessgames thanks for the feedback! I'll try and get it submitted myself is possible, but like I said earlier this project is on my back burner at the moment thanks to college and work, so if you do submit it as a pull request just make sure to tell me so I don't submit a second one on accident lol. |
I just posted PR #86441, which was created from @Mequam's branch at https://github.com/Mequam/funky-godot/tree/mequam/feat/xfce4_focus_grab, since some folks here wanted it! Unfortunately, it doesn't fix the X11 input focus issues that I'm personally experiencing with i3 |
Could some of you reproducing this issue test if #86671 solves the problem for you? |
Don't know about XFCE, but I've tested it on PaperWM+GNOME, and it still steals focus like nuts. steal_focus.mp4 |
For the record: there may be multiple issues. The issue @compese described here on XMonad and which I confirmed here on i3 seems to be fixed on master (0bcc0e9), even if I revert 64a52e0 from #86671. So out of curiosity, I did a |
Hello, i got the same issue. EndeavourOs |
Confirming this behaviour in Qtile on Xorg as well. Godot 4.2.1 stable. |
Can you test if it's fixed for you in Godot 4.3-dev4? A number of X11 focus fixes have already been merged for Godot 4.3. |
Yes, the focus issue is absent in 4.3-dev4. 🎉 |
With the latest 4.2 branch, the issue is resolved for GNOME + PaperWM extension 🎉 |
Godot version
4.0.stable.official.92bee43ad
System information
x86_64 Linux 6.2.2-arch1-1, Intel Core i5-7200U, xfce4
Issue description
When changing workspace on xfce4 godot (both editor and exported games) grabs input focus from any previously opened programs.
focus_steal.mp4
Interestingly I was unable to reproduce the bug on gnome, so whatever the problem is I suspect it is specific to xfce4.
From my testing this appears to be happening because xfce4 issues an extra MapNotify event which the engine uses as an indicator to grab focus.
I have a fix that works for my setup: https://github.com/Mequam/funky-godot/tree/mequam/feat/xfce4_focus_grab but I figured I should make sure that other people are having the same issue before submitting a PR.
Steps to reproduce
Open up godot and some other program.
Focus the other program.
Leave the workspace and return to the workspace.
Minimal reproduction project
N/A, any project works.
The text was updated successfully, but these errors were encountered: