Relaunch a tracked move the way the tool says to - #849
Merged
Conversation
DiffRunner starts a diff tool with the UseShellExecute and CreateNoWindow the tool declares. The tray's "Open diff tool" hard coded ShellExecute and left CreateNoWindow off, so the same tool was started two different ways depending on which surface asked - and the flag a console subsystem tool sets specifically to keep a window off the screen was the one being dropped. Measured before changing anything, because the comment that flag carries says a window flashes without it. On Windows 11 nothing flashes: the console window the hard coded pair produces is zero sized, WS_EX_TOOLWINDOW and WS_EX_NOACTIVATE, so nobody sees it, and a conhost child is attached either way. What the tool's own flags change here is that the window object is not created at all. The reason to do it is still the first paragraph: one launch contract rather than two, on a machine where that comment may well have been earned. The flags are resolved rather than carried, because the payload has no room for them - PiperServer's format is frozen, and every stable DiffEngine embeds the client that writes it. By path first, and then by the executable's name, which is what the bundled viewer needs: the path a move carries is the sending process's, and that one is inside that project's package folder, somewhere the tray has never looked. An exe that resolves to neither keeps the pair this always used. Note that following the tool now also means following UseShellExecute, so a viewer reopened from the tray inherits the tray's handles rather than being detached from them. The tray is a long lived process whose output nobody is reading, which is not the case the ShellExecute default was there to protect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DiffRunner starts a diff tool with the UseShellExecute and CreateNoWindow the tool declares. The tray's "Open diff tool" hard coded ShellExecute and left CreateNoWindow off, so the same tool was started two different ways depending on which surface asked
Measured before changing anything, because the comment that flag carries says a window flashes without it. On Windows 11 nothing flashes: the console window the hard coded pair produces is zero sized, WS_EX_TOOLWINDOW and WS_EX_NOACTIVATE, so nobody sees it, and a conhost child is attached either way. What the tool's own flags change here is that the window object is not created at all. The reason to do it is still the first paragraph: one launch contract rather than two, on a machine where that comment may well have been earned.
The flags are resolved rather than carried, because the payload has no room for them
Note that following the tool now also means following UseShellExecute, so a viewer reopened from the tray inherits the tray's handles rather than being detached from them. The tray is a long lived process whose output nobody is reading, which is not the case the ShellExecute default was there to protect.