X2.44 Current Directory focus corrupted

Chitchat about x² / 2X products

Moderators: fgagnon, nikos, Site Mods

User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

X2.44 Current Directory focus corrupted

Post by JRz »

Hi Nikos,

I've discovered a problem with the current directory in X2 when using multiple windows. I executed a script which assumes the current directory is the folder it was started from. To my surprise, it was executing from another folder! :o I'll try to explain...

For purpose of testing a command script (.cmd or .bat, same difference)with the statements

@echo off
cd
pause

is useful

The scenario is as follows:

Open X2 and go to the folder with your script. Executing the script (double click or enter when it has focus) will give you the desired result. It will echo the folder the script is in to the console.

Now clone a new window (through Ctrl-N or the menu, no matter).
Go to a different folder than the one your script is in.
Close the cloned window.
Now execute the script again. It will show the last folder you were in in the cloned window in stead of the folder the script is in!!

I've found that a focus change in the original X2 window will 'fix' the current dir to the correct path. But if you stay in the same folder after closing the cloned window, it will report the wrong current dir, even when you do something else first like viewing another file or deleting some item.
So only a switch to the second pane and back or a change in folders in the same pane will fix the current dir for the script.

It is only a matter of context for a .cmd or .bat file, because other files are openened normally as you'd expect.

Output of DBMON included to be complete. I think it is the statement "Filesystem path = G:\WORD" that does the damage, no??

Regards, Jan.

DBMON output:
3076: *** TID=77c, Generating folder instance '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\G:\WORD'
3076: Filesystem path = G:\WORD
3076: Shell attributes: (0x7080017f) FILESYSANCESTOR | FILESYSTEM | STORAGEANCESTOR |
3076: Assigned folder type: FITYPE_FILESYSTEM [deciphered]
3076: Folder CLSID: {F3364BA0-65B9-11CE-A9BA-00AA004AE837}
3076: Enumerated 24 objects in the folder, code=1
3076: Delay-creating column handler...IShellFolder2; Columns = 35 (cached)
3076: UWM_VIEWDELAYSORT got rid of 0 redundant messages
3076: SPY(0000009a): Installed on '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\G:\WORD'
3076: Thread 77c pump: unrecognized message 49454 ignored
3076: Frame_c0358 handling command 32858
3076: Thread 77c pump: unrecognized message 49454 ignored
3076: ThreadID=77c: Destroying frame 0x000c0358 'ATL:ExplorerFrame' [xplorer▓ - [Temp @ C:\...] # WORD @ G:\...]
3076: Thread 888 pump: unrecognized message 49454 ignored
3076: Thread 888 pump: unrecognized message 49454 ignored
3076: <<< SantaThreadID=aac goes back to lapland
3076: <<< ThreadID=77c singing off
3076: max ever windows in spy list was 3
3076: santa_aac: Max ever queue length was 1
3076: Thread 888 pump: unrecognized message 49454 ignored
Dumb questions are the ones that are never asked :turn:
User avatar
nikos
Site Admin
Site Admin
Posts: 16341
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

i am aware of the problem but haven't found a clean way to fix it yet. The problem is that x2 as a process can only have one "current directory" regardless of the number of running instances
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post by JRz »

nikos wrote:i am aware of the problem but haven't found a clean way to fix it yet. The problem is that x2 as a process can only have one "current directory" regardless of the number of running instances
Forgive me if I'm wrong, but the obvious solution would be to set the current directory with every 'focus' switch. You do that now anyway with every pane switch.
So if you return to another instance because you are closing a cloned one, setting the current dir to the path of the active pane in the active instance should be enough. I think the performance penalty isn't too big if you would do that?

I discovered that the problem also occurs when you switch to another instance (through Ctrl-W)!
Setting the current dir to the path of the activated pane in the activated window should resolve the problem altogether.

Jan.
Dumb questions are the ones that are never asked :turn:
User avatar
nikos
Site Admin
Site Admin
Posts: 16341
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

the whole issue is to avoid "unnecessary" CDs which can get annoying e.g. when a floppy is active

but fear not because this is already resolved!
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post by JRz »

nikos wrote: but fear not because this is already resolved!
I don't. You've never disappointed me yet. :thumbup:
Dumb questions are the ones that are never asked :turn: