App loses focus after displaying modal dialog #7407

Closed
opened 2026-01-31 01:03:11 +00:00 by claunia · 2 comments
Owner

Originally created by @LarryBrasfield on GitHub (Apr 14, 2020).

Environment

Windows 10 [Version 10.0.18363.720]
Running TCC (a shell from J.P. Software) v.26.01.35
Windows Terminal Version: 0.10.781.0

Steps to reproduce

Cause the app to put up a modal dialog. For example, when running TCC's list command, by typing 'F' to initiate a search. Dismiss the pop-up.

Expected behavior

I expect focus to be returned to the application window that had it before the modal dialog appeared. In this case, that would be the TCC console. I expect to be able to keep typing and have keystrokes reach the app.

Actual behavior

Focus is given to the WT tab for the TCC instance instead. Typing does nothing. It is necessary to use alt-tab or a left-click in the application pane to return focus there before keystrokes again reach the app.

Possible duplicates

I saw several other bugs relating to lost and misplaced focus, but they were marked as fixed in this WT build. So this is either a new bug or reason to revert one of those others to "needs fixing".

Originally created by @LarryBrasfield on GitHub (Apr 14, 2020). # Environment Windows 10 [Version 10.0.18363.720] Running TCC (a shell from J.P. Software) v.26.01.35 Windows Terminal Version: 0.10.781.0 # Steps to reproduce Cause the app to put up a modal dialog. For example, when running TCC's list command, by typing 'F' to initiate a search. Dismiss the pop-up. # Expected behavior I expect focus to be returned to the application window that had it before the modal dialog appeared. In this case, that would be the TCC console. I expect to be able to keep typing and have keystrokes reach the app. # Actual behavior Focus is given to the WT tab for the TCC instance instead. Typing does nothing. It is necessary to use alt-tab or a left-click in the application pane to return focus there before keystrokes again reach the app. # Possible duplicates I saw several other bugs relating to lost and misplaced focus, but they were marked as fixed in this WT build. So this is either a new bug or reason to revert one of those others to "needs fixing".
claunia added the Resolution-Duplicate label 2026-01-31 01:03:11 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 14, 2020):

Okay this is not the most discoverable issue on our backlog, even I had to try a few times to find it and I knew it existed 😆

Shockingly, this is #2988. Conpty has some troubles when applications try to open a window on top of the "console"'s HWND, because conpty doesn't really have an HWND. So if the client app is trying to use GetConsoleWindow to get the Terminal's HWND, they're going to have a bad time.

/dup #2988

@zadjii-msft commented on GitHub (Apr 14, 2020): Okay this is not the most discoverable issue on our backlog, even I had to try a few times to find it and I _knew_ it existed 😆 Shockingly, this is #2988. Conpty has some troubles when applications try to open a window on top of the "console"'s `HWND`, because conpty doesn't really have an `HWND`. So if the client app is trying to use `GetConsoleWindow` to get the _Terminal_'s `HWND`, they're going to have a bad time. /dup #2988
Author
Owner

@ghost commented on GitHub (Apr 14, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Apr 14, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7407