Open Path Sometimes does not Focus ?

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

Open Path Sometimes does not Focus ?

Post by nutnutwin »

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

Re: Open Path Sometimes does not Focus ?

Post by void »

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: 15
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin »

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

Re: Open Path Sometimes does not Focus ?

Post by void »

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: 15
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin »

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: 15
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin »

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: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Open Path Sometimes does not Focus ?

Post by NotNull »

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: 15
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin »

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.
marinelo
Posts: 1
Joined: Fri Apr 08, 2022 1:31 pm

Re: Open Path Sometimes does not Focus ?

Post by marinelo »

Hi,

I found this solution posted by void in 2016 that works for me. I don't encounter issues anymore with the focus when I am using QTTabBar.
Give it a try.
viewtopic.php?t=5588

Please try changing your open path command to $exec($parent("%1"))

In Everything, from the Tools menu, click Options.
Click the Context menu tab.
Select Open Path.
Change the command to:
$exec($parent("%1"))
Click OK.
nutnutwin
Posts: 15
Joined: Sun Feb 21, 2021 8:40 am

Re: Open Path Sometimes does not Focus ?

Post by nutnutwin »

marinelo wrote: Fri Apr 08, 2022 1:39 pm Hi,

I found this solution posted by void in 2016 that works for me. I don't encounter issues anymore with the focus when I am using QTTabBar.
Give it a try.
viewtopic.php?t=5588
Thank you, will try
Post Reply