News:

Welcome to our NEW forum! We invite you to sign up today
so it can grow to be a valuable resource to all Toolbox users!

Main Menu

Focus stealing

Started by ZoltanE, December 12, 2025, 05:05:10 PM

Previous topic - Next topic

ZoltanE

It drives me nuts that apps are able to steal focus: if an app is loading in the background then it must never ever just pop into the foreground when it finally managed to set up its window. It would be great if that could be prevented.

Paul (Lead Developer)

Hi, Zoltan.

AlomWare Toolbox already does have an option to freeze the focus to the current window, such that the only way out of that window is to either stop the freeze again, or hold down the Ctrl key when clicking another window (which then freezes the focus to that new window instead). With this freeze active, no other app and neither the Windows key or Alt+Tab can take you out of the frozen window.

To lock a window this way, you can either middle-click the top-left corner of a window and select "Freeze the focus" from the menu (per the image below), or you can set a hotkey to do it with the automated action below (which toggles freezing of the current window).



(Start)
TIP: Copy from Start to End to paste into an action.
0001 Action: Allow failure messages "0"
0002 Window: Assign active ""
0003 Window: Freeze the focus ""
(End)

Bazza

This works but is a very strong and heavy-handed way to stop focus stealing. Can it be prevented in the way ZoltanE asked, by stopping a random window popping up?

Paul (Lead Developer)

Hi Bazza.

Unfortunately that presents the problem of not being able to literally launch anything at all. Say you have a folder open and you double-click an image inside it to be viewed. Since the folder has the focus, then when the image opens it would get kicked to the background, with the folder retaining the focus instead (because you don't want focus stealing to occur). This is not what the user would want, and that's why we haven't done it.

Maybe there's a better way to do it that we've overlooked. Come up with something good and I'll implement it.

Paul.

ZoltanE

I see the problem now... So in my case there are two apps that take long to load so I start doing other stuff and at some point my clicks start to be blocked by the still invisible, under construction app windows...  ::)

Could we perhaps make a blacklist of apps/processes which are not allowed to steal focus? They had focus when I started them and they started loading, but lost it. In that case they would not be allowed to get it back without me explicitly focusing them.

At least that's the idea although the app in question has child processes and I have no idea how those affect things...

Paul (Lead Developer)

Looking into the blacklist idea.