Skip to content

Relaunch a tracked move the way the tool says to - #849

Merged
SimonCropp merged 1 commit into
mainfrom
fix-tray-relaunch-flags
Aug 23, 2026
Merged

Relaunch a tracked move the way the tool says to#849
SimonCropp merged 1 commit into
mainfrom
fix-tray-relaunch-flags

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

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.

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.
@SimonCropp
SimonCropp merged commit 8a591fd into main Aug 23, 2026
10 checks passed
@SimonCropp
SimonCropp deleted the fix-tray-relaunch-flags branch August 23, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant