Activate SuperPuTTY when an embedded terminal is clicked - #964
Open
greyhair-atx wants to merge 1 commit into
Open
Activate SuperPuTTY when an embedded terminal is clicked#964greyhair-atx wants to merge 1 commit into
greyhair-atx wants to merge 1 commit into
Conversation
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.
Problem
When SuperPuTTY is behind another application, clicking directly inside an embedded PuTTY terminal can focus the child PuTTY process without activating the SuperPuTTY host window. Clicking SuperPuTTY-owned controls such as its menu bar activates the host normally.
The existing foreground-event handling was intended to cover this case, but foreground hooks were skipped for embedded windows with
WS_DLGFRAME, which includes standard PuTTY windows. The out-of-context WinEvent callback also accessed WinForms controls directly instead of dispatching through the UI thread.Changes
EVENT_SYSTEM_FOREGROUNDfor every successfully embedded terminal window, including framed PuTTY windows.SetForegroundWindowfails.SetWinEventHookresults and log registration failures with the Win32 error.Verification
LocalViewModeltest: passed when run independentlyThe legacy
LocalViewModeltest failed once when run in the combined five-test group because its asynchronous property-change callback arrived after the assertion; it passed immediately when rerun alone. This behavior predates and is unrelated to the foreground-focus changes.