Page 1 of 1

Everything opens without focus if after using Start Menu

Posted: Tue Oct 15, 2019 7:31 pm
by mschmitt
Everything 1.4.1.935 (x64) on Windows 10 1709. "Show tray icon" and "Single click tray" are selected.

Normally if single-click on the tray icon, an Everything window opens or is reused. That window gains focus.

The problem is that if the Start Menu is the last action taken, then the Everything window does not gain focus: if "Create a new window from the system tray" is selected, a new window opens but it does not have focus, if that option is not selected then a current Everything window does not gain focus.

For example:
  1. Select "single click tray" and "create a new window from the system tray"
  2. Click the Start button so the Start Menu opens
  3. Click the Start button again so the Start Menu closes
  4. Click the Everything icon in the tray
The result is that an Everything window opens but does not have focus. You have to click it to start typing in the search area.

Re: Everything opens without focus if after using Start Menu

Posted: Tue Oct 15, 2019 8:16 pm
by therube
Confirmed.

You should see the tasbar icon blink as you blindly type nothing into the Everything search bar.

Re: Everything opens without focus if after using Start Menu

Posted: Tue Oct 15, 2019 9:51 pm
by NotNull
Not tested, but this is Windows behaviour.
If you activate the taskbar first, by clicking on an empty part of it, and then click the Everything icon, it should work.

Re: Everything opens without focus if after using Start Menu

Posted: Fri Oct 18, 2019 11:00 am
by void
Thanks for bringing this to my attention.
I too am able to reproduce the issue on Windows 10 x64 1903.
It doesn't appear to be an issue on Windows 7.

Please try Everything 1.4.1.954.

This version adds a call to AttachThreadInput before setting Everything as the foreground window. It appears to fix the issue for me on Windows 10 x64 1903.

Re: Everything opens without focus if after using Start Menu

Posted: Fri Oct 18, 2019 2:41 pm
by mschmitt
Close. It works as expected every time except the first time the system tray is used after it is launched.

I have "Create a new window from the system tray" selected.
  • Exit Everything. You don't have to stop the service.
  • Launch Everything. An Everything window opens.
  • Click on the tray icon.
The result is that a new Everything windows open, and it has focus? You can type into it, and what was previously the foreground window isn't, but the title bar is still white.

I have Windows 10 set so that the active window's title bar has the accent color, on standard windows (i.e. other than windows like in Microsoft Office that do their own thing). Everything's title bar didn't change color in this case.

But after the first time, it works as expected.

Re: Everything opens without focus if after using Start Menu

Posted: Tue Oct 22, 2019 5:18 am
by void
Please try Everything 1.4.1.955.

You will need to enable "set_foreground_window_attach_thread_input" with this version and future versions as attaching thread input can cause the taskbar and Everything to hang.
This version also fixes the issue with title bar not showing as the active window.

To enable set_foreground_window_attach_thread_input:
  • In Everything, type in the following search and press ENTER:
    /set_foreground_window_attach_thread_input=1
It's odd that all Microsoft programs don't have this issue and all the non-Microsoft programs that I tested do..

Re: Everything opens without focus if after using Start Menu

Posted: Tue Oct 22, 2019 3:00 pm
by mschmitt
That works, thanks.

I'm wondering about needing to set_foreground_window_attach_thread_input in future versions. The change isn't persistent? Or do you mean that it would still be required to set it one time on future (fresh) installs?

Also, I read Chen's posts last week. Windows trying to stop apps stealing focus is good, as stealing focus is a crime against the user. But what is the provision for something like this, where the user is explicitly trying to given an app focus? It seems like there should be a way to do that, that isn't a hack.

Re: Everything opens without focus if after using Start Menu

Posted: Thu Oct 24, 2019 5:36 am
by void
Until I can figure out how Microsoft programs are working (eg: Task Manager) you'll need manually set set_foreground_window_attach_thread_input to enable this "hack".
You'll only need to enable this for fresh installs.
Also, I read Chen's posts last week. Windows trying to stop apps stealing focus is good, as stealing focus is a crime against the user. But what is the provision for something like this, where the user is explicitly trying to given an app focus? It seems like there should be a way to do that, that isn't a hack.
It's a bug with Windows 10. I expect my window to have setforeground privileges after clicking on its taskbar notification icon.
This wasn't an issue with older versions of Windows.

Stealing focus is bad. With this fix/hack, Everything will only steal focus when it creates a new window.
This normally only occurs from user input when Everything is in the foreground, running Everything.exe and from Hotkeys.