Everything opens without focus if after using Start Menu

Found a bug in "Everything"? report it here
Post Reply
mschmitt
Posts: 30
Joined: Thu Jul 19, 2018 8:03 pm

Everything opens without focus if after using Start Menu

Post 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.
Last edited by mschmitt on Tue Oct 15, 2019 10:08 pm, edited 1 time in total.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Everything opens without focus if after using Start Menu

Post by therube »

Confirmed.

You should see the tasbar icon blink as you blindly type nothing into the Everything search bar.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Everything opens without focus if after using Start Menu

Post 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.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything opens without focus if after using Start Menu

Post 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.
mschmitt
Posts: 30
Joined: Thu Jul 19, 2018 8:03 pm

Re: Everything opens without focus if after using Start Menu

Post 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.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything opens without focus if after using Start Menu

Post 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..
mschmitt
Posts: 30
Joined: Thu Jul 19, 2018 8:03 pm

Re: Everything opens without focus if after using Start Menu

Post 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.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything opens without focus if after using Start Menu

Post 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.
Post Reply