Open Path Sometimes does not Focus ?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
nutnutwin
Posts: 5
Joined: Sun Feb 21, 2021 8:40 am

Open Path Sometimes does not Focus ?

Post by nutnutwin » Sun Feb 21, 2021 8:43 am

It happens from time to time (1/5 or so)
When I choose to open a result by Ctrl+Enter(Open Path)

Sometimes the object is focused, while sometimes it is not

I am using Recent QTTabBar as a plugin. wonder if anyone else has such problem?

Thank you

void
Site Admin
Posts: 6058
Joined: Fri Oct 16, 2009 11:31 pm

Re: Open Path Sometimes does not Focus ?

Post by void » Sun Feb 21, 2021 8:44 am

It's a bug with Windows Explorer, the item is only focused when it is cached.

I'll look into caching the item before opening the path.

nutnutwin
Posts: 5
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin » Sun Feb 21, 2021 8:47 am

void wrote:
Sun Feb 21, 2021 8:44 am
It's a bug with Windows Explorer, the item is only focused when it is cached.

I'll look into caching the item before opening the path.
hi
thank you for the Instant Reply

What do you mean bu cached?

wonder if there is a workaround using tools like autohotkey to pre cache it

void
Site Admin
Posts: 6058
Joined: Fri Oct 16, 2009 11:31 pm

Re: Open Path Sometimes does not Focus ?

Post by void » Sun Feb 21, 2021 8:50 am

cached = Windows Explorer needs to have seen this object before.
When cached, Windows Explorer will remember the filename and some file properties.

When the path is opened, Windows Explorer will load/cache all the items in the path.
If this is too slow, Windows Explorer will not know which item to select.

It is also possible for Windows Explorer to load all the items in the path instantly, which is why you see it work some of the time.

An Autohotkey script might work?
Open the path, close the Windows Explorer window, wait a few milliseconds, reopen the path.
I'm not sure of a way to know when the object is cached.

Everything uses SHOpenFolderAndSelectItems to open paths and select objects.

You can change the Everything open path command from Tools -> Options -> Context Menu -> Open Path -> Command

nutnutwin
Posts: 5
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin » Sun Feb 21, 2021 11:06 am

void wrote:
Sun Feb 21, 2021 8:50 am
cached = Windows Explorer needs to have seen this object before.
When cached, Windows Explorer will remember the filename and some file properties.

When the path is opened, Windows Explorer will load/cache all the items in the path.
If this is too slow, Windows Explorer will not know which item to select.

It is also possible for Windows Explorer to load all the items in the path instantly, which is why you see it work some of the time.

An Autohotkey script might work?
Open the path, close the Windows Explorer window, wait a few milliseconds, reopen the path.
I'm not sure of a way to know when the object is cached.

Everything uses SHOpenFolderAndSelectItems to open paths and select objects.

You can change the Everything open path command from Tools -> Options -> Context Menu -> Open Path -> Command
Yeah Great idea
Will try later

nutnutwin
Posts: 5
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin » Mon Feb 22, 2021 1:36 pm

void wrote:
Sun Feb 21, 2021 8:50 am
cached = Windows Explorer needs to have seen this object before.
When cached, Windows Explorer will remember the filename and some file properties.

When the path is opened, Windows Explorer will load/cache all the items in the path.
If this is too slow, Windows Explorer will not know which item to select.

It is also possible for Windows Explorer to load all the items in the path instantly, which is why you see it work some of the time.

An Autohotkey script might work?
Open the path, close the Windows Explorer window, wait a few milliseconds, reopen the path.
I'm not sure of a way to know when the object is cached.

Everything uses SHOpenFolderAndSelectItems to open paths and select objects.

You can change the Everything open path command from Tools -> Options -> Context Menu -> Open Path -> Command
Just a thought,
「SHOpenFolderAndSelectItems」 was mentioned, I remember that
- in VSCode, 「File: Reveal in File Explorer」 seems always focus on the target
- If I use Non Native File Explorer(like XYplorer ) combined with AutoHotkey in Everything
like,
Copy Full Path
Open in XYplorer with Commandline, it always focus

Not a question, just trying to work out a workaround...

Thank you

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Open Path Sometimes does not Focus ?

Post by NotNull » Mon Feb 22, 2021 2:13 pm

Does this help? :
(I assume you are running the 64-bit version of Everything)
  • In Everything, go to Menu:Tools > Options > General > Context Menu
  • Select Open Path
  • In the Command box, replace $openpath("%1") with

    Code: Select all

    $exec("%SystemRoot%\explorer.exe" /select,"%1")
  • Click the OK buton
That causes File Explorer to be started in a slightly different way.
According to my calculations/ male intuition/ fortune teller / .. this should help with this issue

nutnutwin
Posts: 5
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin » Mon Feb 22, 2021 2:26 pm

NotNull wrote:
Mon Feb 22, 2021 2:13 pm
Does this help? :
(I assume you are running the 64-bit version of Everything)
  • In Everything, go to Menu:Tools > Options > General > Context Menu
  • Select Open Path
  • In the Command box, replace $openpath("%1") with

    Code: Select all

    $exec("%SystemRoot%\explorer.exe" /select,"%1")
  • Click the OK buton
That causes File Explorer to be started in a slightly different way.
According to my calculations/ male intuition/ fortune teller / .. this should help with this issue
Hi, it works by creating a new window and focus on the file
Now I need to get QTTabBar catch the new window...

But really thanks you.

Post Reply