Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Settings] : System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key. #11970

Closed
Saiteja341 opened this issue Dec 16, 2021 · 7 comments · Fixed by #14221
Assignees
Labels
A11yCO Accessibility tracking A11yTTValidated Yet another label for the a11y folks. They want so many. So so many. A11yUsable Accessibility tracking Area-Accessibility Issues related to accessibility HCL-E+D Accessibility tracking HCL-WindowsTerminal Accessibility tracking Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@Saiteja341
Copy link

Windows Terminal version

1.12.3472.0

Windows build number

22509.1011

Other Software

**Test Environment: **
OS: Windows 11 Version Dev (OS Build 22509.1011)
App: Windows Terminal Preview

Steps to reproduce

**Repro Steps: **

1.Open Windows Terminal.
2.Open Settings page using 'Ctr+,'
3.Now try to open the 'System menu' pop-up by pressing 'Alt + Space' key.
4.Observe the issue.

**User Experience: **
Users will not be able to 'System menu' pop-up functionalities in 'Settings' window, if System menu pop-up doesn't open inside 'Settings' window on pressing 'Alt + Space' key.

Attachment :
System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key..zip

Expected Behavior

System menu pop-up should open inside 'Settings' window, when user press 'Alt + Space' key.

Actual Behavior

System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 16, 2021
@zadjii-msft zadjii-msft added Area-Accessibility Issues related to accessibility Product-Terminal The new Windows Terminal. labels Dec 16, 2021
@ghost ghost added A11yCO Accessibility tracking A11yUsable Accessibility tracking HCL-E+D Accessibility tracking HCL-WindowsTerminal Accessibility tracking Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Tag-Fix Doesn't match tag requirements labels Dec 17, 2021
@zadjii-msft zadjii-msft added this to the Backlog milestone Jan 3, 2022
@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jan 3, 2022
@zadjii-msft
Copy link
Member

Huh. Sure doesn't. Probably should. I'm guessing there's some magic reason that Alt+Space isn't delivered to the SUI, which is causing us to never raise a OpenSystemMenu action, so it never gets to TerminalPage::_HandleOpenSystemMenu. That's where I'd start.

@zadjii-msft
Copy link
Member

zadjii-msft commented Aug 2, 2022

Note to selves: it just generally doesn't work from the command palette either. Why does it need to go through a TermControl? that's weird.

Or read-only panes. weird.

@ianjoneill
Copy link
Contributor

So the reason this doesn't work in the settings UI is because Alt + Space is special cased in the app's main method to delegate through to AppHost::OnDirectKeyEvent(), which in turn delegates through to AppLogic::OnDirectKeyEvent().

This method iterates through the UI tree and passes the key event through to IDirectKeyListener implementations - of which the settings UI's MainPage isn't one.

Hitting Alt + Space in the command palette doesn't work either - it does implement IDirectKeyListener, but only seems to care about the Alt key-up event and doesn't handle Alt + Space.

I've been looking at this for a while now, and can't come up with a nice way of refactoring the code so that hitting Alt + Space works in all three places. The TermControl logic below doesn't refactor out (I was thinking up to AppLogic) well - as it uses methods on ControlSettings, which AppLogic (or MainPage for that matter) doesn't know anything about.

else if ((vkey == VK_F7 || vkey == VK_SPACE) && down)
{
// Manually generate an F7 event into the key bindings or terminal.
// This is required as part of GH#638.
// Or do so for alt+space; only send to terminal when explicitly unbound
// That is part of #GH7125
auto bindings{ _core.Settings().KeyBindings() };
auto isUnbound = false;
const KeyChord kc = {
modifiers.IsCtrlPressed(),
modifiers.IsAltPressed(),
modifiers.IsShiftPressed(),
modifiers.IsWinPressed(),
gsl::narrow_cast<WORD>(vkey),
0
};
if (bindings)
{
handled = bindings.TryKeyChord(kc);
if (!handled)
{
isUnbound = bindings.IsKeyChordExplicitlyUnbound(kc);
}
}

Oddly, the "Open system menu" action does work if you click it from within the command palette - it just doesn't work if you press the enter key with it highlighted. In both cases the action does fire, and IslandWindow::OpenSystemMenu() does get called - but when enter is pressed, the call to TrackPopupMenu() doesn't seem to do anything.

@carlos-zamora
Copy link
Member

Originally filed in MSFT-41390832

@carlos-zamora carlos-zamora modified the milestones: Backlog, Terminal v1.17 Oct 13, 2022
@carlos-zamora carlos-zamora self-assigned this Oct 13, 2022
@ghost ghost added the In-PR This issue has a related PR label Oct 13, 2022
DHowett added a commit that referenced this issue Oct 14, 2022
This pull request operates on the same theory as #14217, but at a lower
level. Carlos and I discovered that TerminalPage *already* has an
action-dispatching key preview handler, and that my implementation of
IDirectKeyListener handles focus-tree bubbling mostly correctly.

Because of that discovery, we could move the IDirectKeyListener into
TerminalPage itself and not have to complicate the SUI or the Command
Palette with the DirectKey interface.

Validation:
When bound to Alt+Space, the system menu works in the command palette,
the settings UI, and in read-only panes.

Fixes #11970
Closes #14217
Fixes MSFT-41390832
@ghost ghost closed this as completed in #14221 Oct 14, 2022
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Oct 14, 2022
ghost pushed a commit that referenced this issue Oct 14, 2022
This pull request operates on the same theory as #14217, but at a lower
level. Carlos and I discovered that TerminalPage *already* has an
action-dispatching key preview handler, and that my implementation of
`IDirectKeyListener` handles focus-tree bubbling mostly correctly.

Because of that discovery, we learned we could move the
`IDirectKeyListener` into TerminalPage itself and not have to complicate
the SUI or the Command Palette with the DirectKey interface.

Validation:
When bound to Alt+Space, the system menu works in the command palette,
the settings UI, and in read-only panes.

Fixes #11970
Closes #14217
Fixes MSFT-41390832
DHowett added a commit that referenced this issue Oct 14, 2022
This pull request operates on the same theory as #14217, but at a lower
level. Carlos and I discovered that TerminalPage *already* has an
action-dispatching key preview handler, and that my implementation of
`IDirectKeyListener` handles focus-tree bubbling mostly correctly.

Because of that discovery, we learned we could move the
`IDirectKeyListener` into TerminalPage itself and not have to complicate
the SUI or the Command Palette with the DirectKey interface.

Validation:
When bound to Alt+Space, the system menu works in the command palette,
the settings UI, and in read-only panes.

Fixes #11970
Closes #14217
Fixes MSFT-41390832

(cherry picked from commit d319d47)
Service-Card-Id: 86228469
Service-Version: 1.15
DHowett added a commit that referenced this issue Oct 14, 2022
This pull request operates on the same theory as #14217, but at a lower
level. Carlos and I discovered that TerminalPage *already* has an
action-dispatching key preview handler, and that my implementation of
`IDirectKeyListener` handles focus-tree bubbling mostly correctly.

Because of that discovery, we learned we could move the
`IDirectKeyListener` into TerminalPage itself and not have to complicate
the SUI or the Command Palette with the DirectKey interface.

Validation:
When bound to Alt+Space, the system menu works in the command palette,
the settings UI, and in read-only panes.

Fixes #11970
Closes #14217
Fixes MSFT-41390832

(cherry picked from commit d319d47)
Service-Card-Id: 86228470
Service-Version: 1.16
@ghost
Copy link

ghost commented Oct 18, 2022

🎉This issue was addressed in #14221, which has now been successfully released as Windows Terminal v1.15.2874.:tada:

Handy links:

@Shubham786786 Shubham786786 added the A11yTTValidated Yet another label for the a11y folks. They want so many. So so many. label Nov 10, 2022
@Shubham786786
Copy link

Closing the bug as issue is fixed on the latest build:
Windows Terminal Preview Version: 1.17.3052.0

@ghost
Copy link

ghost commented Dec 14, 2022

🎉This issue was addressed in #14221, which has now been successfully released as Windows Terminal Preview v1.16.3463.0 and v1.16.3464.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11yCO Accessibility tracking A11yTTValidated Yet another label for the a11y folks. They want so many. So so many. A11yUsable Accessibility tracking Area-Accessibility Issues related to accessibility HCL-E+D Accessibility tracking HCL-WindowsTerminal Accessibility tracking Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
5 participants