When using PasteIntoFile in tray mode and pressing the WIN+ALT+V Hotkey, a heuristic is used to determine the path of the active explorer window:
|
/// <summary> |
|
/// Heuristic method to get the path of a shell window |
|
/// </summary> |
|
/// <param name="explorer">File Explorer or Desktop shell window</param> |
|
/// <returns></returns> |
|
private static string GetExplorerPath(InternetExplorer explorer) { |
When the active explorer window has multiple tabs (Win 11 feature), this heuristic fails to determine the active tab, and always returns the path of the first tab.
This causes pasting with the hotkey to fail in any but the first tab, since the image is pasted unexpectedly to the path opened in the first tab and not the active tab.
In addition, if autosave is used, the "AsyncRequestFilenameEdit" also fails (unclear if it would work out of the box if the path was correct, or some additional fix is required for the "SelectFileInWindow" method used for this purpose.
To Reproduce
- Enable PasteIntoFile to run in tray mode
- Open a File Explorer and brows to some folder, then open a second tab with a different folder
- With the second tab selected, press WIN+ALT+V and notice the Folder being set to the path of the first tab (or the file being directly pasted there if autosave is enabled)
Error message
Screenshots
Environment
- App version: 5.6.1
- OS: Windows 11
- ...
Solution approach / workarounds
...
When using PasteIntoFile in tray mode and pressing the WIN+ALT+V Hotkey, a heuristic is used to determine the path of the active explorer window:
PasteIntoFile/PasteIntoFile/ExplorerUtil.cs
Lines 22 to 27 in 596def7
When the active explorer window has multiple tabs (Win 11 feature), this heuristic fails to determine the active tab, and always returns the path of the first tab.
This causes pasting with the hotkey to fail in any but the first tab, since the image is pasted unexpectedly to the path opened in the first tab and not the active tab.
In addition, if autosave is used, the "AsyncRequestFilenameEdit" also fails (unclear if it would work out of the box if the path was correct, or some additional fix is required for the "SelectFileInWindow" method used for this purpose.
To Reproduce
Error message
Screenshots
Environment
Solution approach / workarounds
...