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

Users cannot Touch Inspect window caption controls #13631

Open
DHowett opened this issue Jul 29, 2022 · 2 comments
Open

Users cannot Touch Inspect window caption controls #13631

DHowett opened this issue Jul 29, 2022 · 2 comments
Labels
Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@DHowett
Copy link
Member

DHowett commented Jul 29, 2022

  1. Open Terminal
  2. On a touch device, start Narrator
    1. Hover over title bar content such as min/max/close buttons
    2. Observe that Narrator cannot find the controls
  3. Alternative, use Inspect and use it to hit test the title bar content
    1. Observe that hit testing in Inspect doesn't find the min/max/close controls

It is worth noting that the tabs in the title bar hit test correctly. The draggable part also hit tests, but Inspect shows that the bounding rect extends beyond the bounds of the window (looks like the width is that of the window rather than (window - tabs)).

Notes from original reporter

This issue was discovered in the investigation of a similar issue in File Explorer. We believe it is up to providers
to support hit testing when their client area extends into the title bar.

In this scenario, the issue is that the app has specified that its client area includes the non-client area of the
title bar. UIA makes sure not to override any hit testing that is within the client area of an app.

To make this work, we recommend following the pattern of other apps that extend their client area into the title bar,
such as WordPad:

  1. Set the provider option to remove UIA non-client area support (may be more of an optimization and not strictly
    required) by returning ProviderOptions_RefuseNonClientSupport.

ex:

CUxHWNDElementProvider::get_ProviderOptions  
{  
// <snip> 
     // Claim support for the non-client area   
    *pRetVal = (ProviderOptions)(ProviderOptions_ServerSideProvider | ProviderOptions_RefuseNonClientSupport);  
    return S_OK;  
}  
  1. Update client-area hit testing to also test non-client controls, such as min/max/close buttons.

ex:

CUxHWNDElementProvider::RootElementProviderFromPoint  
// <snip> 
    // Ask the main frame what caption element pt is on, if any
    POINT pt = {static_cast<LONG>(x), static_cast<LONG>(y)}; 
    LRESULT lHit = SendMessage(_hwndMain, WM_NCHITTEST, 0, POINTTOPOINTS(pt)); 
 
    // Special case for custom caption elements: this could potentially be a custom child element 
    // Those values are returned by HWndContainer::OnNcHitTest 
    if (lHit == HTCAPTION || lHit == HTBORDER) 
    { 
// <snip> --- Special handling for custom controls in title bar --- 
    } 

    // If we don't have anything yet, try the regular hit-testing for non-client. 
    if (pProvider == NULL) 
    { 
// <snip> --- maps lHit to OBJID_* --- 
            // Get the non-client provider for this piece and wrap it up 
            IRawElementProviderSimple * pRawProvider; 
            hr = UiaProviderForNonClient(_hwndMain, lEnd, CHILDID_SELF, &pRawProvider); 
...  

Ported from MSFT-38927143

@DHowett DHowett added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Accessibility Issues related to accessibility Product-Terminal The new Windows Terminal. Priority-2 A description (P2) labels Jul 29, 2022
@DHowett DHowett added this to the Terminal v1.17 milestone Jul 29, 2022
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 29, 2022
@zadjii-msft
Copy link
Member

Hey we may need to do this for theming! There's a mail thread titled "RE: Snap Flyouts only over DWM caption buttons?". See also #10509

@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Aug 1, 2022
@zadjii-msft
Copy link
Member

Maybe also related: #11260

@zadjii-msft zadjii-msft modified the milestones: Terminal v1.17, Backlog Sep 7, 2022
ghost pushed a commit that referenced this issue Dec 9, 2022
This reverts commit 19b6d35.

This re-enables support for Mica, and transparent titlebars in general. It also syncs the titlebar opacity with the control opacity for `terminalBackground`. It also somehow fixes the bug where the bottom few pixels of the max btn doesn't work to trigger the snap flyout.

Closes #10509 

Does nothing for #13631

### To-done's

* [x] Check the mica API on 22000, windows 11 RTM
  - this works on 10.0.22621.674, but that's not 22000
* [x] Check how this behaves on windows 10. 
  - For both, this API just no-ops. That's fine! we can just say "Mica is only supported on >=22621"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

2 participants