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

Make sure MinMaxCloseControl supports fullscreen and tablet mode #6660

Closed
wants to merge 2 commits into from

Conversation

AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Jun 24, 2020

Summary of the Pull Request

Caption buttons support fullscreen and tablet mode

References

https://devblogs.microsoft.com/oldnewthing/?p=93815
https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/move-to-winrt-from-wrl
https://devblogs.microsoft.com/oldnewthing/20170405-00/?p=95905

PR Checklist

  • Closes Make sure MinMaxCloseControl supports FullScreen & Tablet Mode #2001
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

Used this to add support for detecting tablet mode

The PR is a work in progress and the code doesn't work in its current state

Validation Steps Performed

None
You know how it is, coded on phone, can't get it to compile 😔

@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Jun 24, 2020
@@ -788,6 +810,15 @@ void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
return FALSE;
}

WRL::ComPtr<IUIViewSettingsInterop> interop;
Windows::Foundation::GetActivationFactory(WRL::Wrappers::HStringReference(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DHowett Please tell me how to convert it from WRL to winrt🙏🙏

Copy link
Member

@DHowett DHowett Jul 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, to convert this from WRL to WinRT, all you need to do is.. replace all this code with:

auto viewSettingsForWindow = winrt::Windows::UI::ViewManagement::UIViewSettings::GetForWindow(hwnd);

C++/WinRT makes winrt look like modern C++, so you don't need to do any weird smart pointer types or IID management.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, but if you have to use an Interop class... then things get weird and annoying. You actually can't use c++/winrt directly for this. lol ☹️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, using an interop class is the only way I know of. Summoning the legend himself for guidance : @oldnewthing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you mean

    UIViewSettings viewSettingsForWindow{ nullptr };
    get_activation_factory<IUIViewSettingsInterop>(name_of<UIViewSettings>())->
        GetForWindow(hwnd, guid_of<UIViewSettings>(), put_abi(viewSettingsForWindow));

or if you like one-liners

    auto viewSettingsForWindow =
        capture<IInspectable>(
            get_activation_factory<IUIViewSettingsInterop>(name_of<UIViewSettings>()),
            &IUIViewSettingsInterop::GetForWindow,
            hwnd).as<UIViewSettings>();

@microsoft-github-updates microsoft-github-updates bot changed the base branch from master to main October 22, 2020 00:27
@zadjii-msft
Copy link
Member

Hey this one's been sitting open for quite some time now - @AnuthaDev any plans to come back around and finish this one?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 2, 2021
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Dec 10, 2021
@ghost
Copy link

ghost commented Dec 10, 2021

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost ghost closed this Dec 17, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make sure MinMaxCloseControl supports FullScreen & Tablet Mode
4 participants