Skip to content

InputNonClientPointerSource no longer works after removing titlebar with SetBorderAndTitleBar #9661

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

Closed
HO-COOH opened this issue May 21, 2024 · 3 comments
Labels
area-TitleBar Issues related to custom window title bars. area-Windowing closed-Fixed Described behavior has been fixed. team-CompInput Issue for IXP (Composition, Input) team

Comments

@HO-COOH
Copy link

HO-COOH commented May 21, 2024

Describe the bug

I am trying to completely self-drawing the titlebar buttons, so I use presenter.SetBorderAndTitleBar(false, false); to remove the titlebar together with the caption buttons. Then I found InputNonClientPointerSource to set draggable regions no longer works.

This is an issue for developers trying to completely self-drawing a window.

Steps to reproduce the bug

  1. In window constructor, use this code to completely remove the titlebar (along with the standard caption buttons)
            ExtendsContentIntoTitleBar(true);
            auto presenter = AppWindow().Presenter().as<winrt::Microsoft::UI::Windowing::OverlappedPresenter>();
            presenter.SetBorderAndTitleBar(false, false);
  1. Use this code to set a draggable region
    auto source = winrt::Microsoft::UI::Input::InputNonClientPointerSource::GetForWindowId(winrt::Microsoft::UI::GetWindowIdFromWindow(/*get hwnd from this window*/));
    source.ClearRegionRects(winrt::Microsoft::UI::Input::NonClientRegionKind::Caption);
    source.SetRegionRects(
        winrt::Microsoft::UI::Input::NonClientRegionKind::Caption,
        {
            winrt::Windows::Graphics::RectInt32{
                .X = (int)0,
                .Y = (int)0,
                .Width = (int)400,
                .Height = (int)400
            }
        }
    );

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.5.3: 1.5.240428000

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 1809 (17763, October 2018 Update)

IDE

No response

Additional context

No response

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label May 21, 2024
@codendone codendone transferred this issue from microsoft/WindowsAppSDK May 23, 2024
@codendone codendone added team-CompInput Issue for IXP (Composition, Input) team area-TitleBar Issues related to custom window title bars. area-Windowing and removed needs-triage Issue needs to be triaged by the area owners labels May 23, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@hiteshkrmsft hiteshkrmsft closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2025
@hiteshkrmsft hiteshkrmsft added the closed-NotRepro Described behavior could not be reproduced. label Feb 1, 2025
@codendone
Copy link
Contributor

Copying comment from the internal bug:

Cannot repro this in 1.6 or 1.7.

@HO-COOH
Copy link
Author

HO-COOH commented Feb 4, 2025

Just checked it, it indeed repro with 1.5x releases (the release in the OP) and is fixed with latest 1.6 releases, thanks for the fix. @codendone You might want to change the tag to Not repro to Fixed. Anyone interested, I have a repro

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Feb 4, 2025
@codendone codendone added closed-Fixed Described behavior has been fixed. and removed needs-triage Issue needs to be triaged by the area owners closed-NotRepro Described behavior could not be reproduced. labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TitleBar Issues related to custom window title bars. area-Windowing closed-Fixed Described behavior has been fixed. team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

3 participants