How to keep new windows from grabbing focus

This is quite a general question, since this disturbs me about every OS GUI I have encountered so far.

Typical case: Some windows come up at startup. I start typing in a password in one window. Another window (preferrable something communicating with the outside worlds) grabs focus while I type the password and shows part of it in clear, and as a result I am getting really upset.

Second example. I start a browser that, on startup, opens many windows. I have forgotten to close another heavy application, knowing that the machine will probably freeze when both are open. I try to close the other application, but every single reconstructed browser window steals the focus and keeps me from closing the other applicatrion. The machine freezes, and again I am at the verge of happily kicking the hardware through the closed window.

MY GOD, isn’t it ***** possible to keep the OS GUI from doing this ****? Is it possible to peacfully continue with one open window and not be interrupted by everything that opens up in the background where it could wait till I really want to deal with it?

Is there some lever or option within Lubuntu (currently 20.04) and whatever window manager to manage that? I’d be rather grateful.

Thanks so far!

1 Like

Try app menu > preferences > LXQt Settings > Openbox settings > Windows > untick ‘focus new windows as they appear’.

I’m pretty sure that’ll do it, but haven’t actually tested it. It’s also probably in the manual.

2 Likes

Thanks a lot, learnt something new. I tried it with the browser. It still opens all windows in the foreground, not in the background, so perhaps it is a partial solution. Yet, you are right with your hint at RTFM, of course, which I should have done before asking here. I’ll try to do that before I come back here.

It being openbox, you may need to restart it to have it take effect.

openbox --restart

When changed, it should stop new windows from stealing the focus - I would think. Though, yeah, it’d not surprise me if they still opened on top but without stealing focus. That sounds like something openbox would do.

Ah, thanks! Did not think of this detail. Did it now. Behavior has changed. The windows of the browser still open all in front of whatever is open. I click the other applications window inbetween, the browser windows still eclipse it one after the other, but they do not take the focus. This I have tested by typing blindly. Everything I have typed really appears in the original, then eclipsed window. So the option does exactly what it name indicates, and my problem is solved at least half, even if this behavior seems somewhat odd.

2 Likes

I suspect that’s about as good as you’re gonna get. There may be some setting to open new windows in the background, but I can’t find it anywhere.

I will still wait for some time whether someone unexpectedly finds another solution to this. But most probably that won’t happen, so in this case I will mark yours the solution. It seems strange to me, though, that this has obviously never disturbed enough users to lead to a different implementation.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.