@@ -53,15 +53,6 @@ namespace winrt::TerminalApp::implementation
5353 }
5454 });
5555
56- // GH#9162 - when the header is done renaming, ask for focus to be
57- // tossed back to the control, rather into ourselves.
58- _headerControl.RenameEnded ([weakThis = get_weak ()](auto &&, auto &&) {
59- if (auto tab{ weakThis.get () })
60- {
61- tab->_RequestFocusActiveControlHandlers ();
62- }
63- });
64-
6556 _UpdateHeaderControlMaxWidth ();
6657
6758 // Use our header control as the TabViewItem's header
@@ -92,7 +83,7 @@ namespace winrt::TerminalApp::implementation
9283 // - <none>
9384 void TerminalTab::_MakeTabViewItem ()
9485 {
95- TabBase::_MakeTabViewItem ( );
86+ TabViewItem (::winrt::MUX::Controls::TabViewItem{} );
9687
9788 TabViewItem ().DoubleTapped ([weakThis = get_weak ()](auto && /* s*/ , auto && /* e*/ ) {
9889 if (auto tab{ weakThis.get () })
@@ -858,23 +849,14 @@ namespace winrt::TerminalApp::implementation
858849 }
859850
860851 // Build the menu
861- Controls::MenuFlyout contextMenuFlyout ;
852+ Controls::MenuFlyout newTabFlyout ;
862853 Controls::MenuFlyoutSeparator menuSeparator;
863- contextMenuFlyout.Items ().Append (chooseColorMenuItem);
864- contextMenuFlyout.Items ().Append (renameTabMenuItem);
865- contextMenuFlyout.Items ().Append (duplicateTabMenuItem);
866- contextMenuFlyout.Items ().Append (menuSeparator);
867-
868- // GH#5750 - When the context menu is dismissed with ESC, toss the focus
869- // back to our control.
870- contextMenuFlyout.Closed ([weakThis](auto &&, auto &&) {
871- if (auto tab{ weakThis.get () })
872- {
873- tab->_RequestFocusActiveControlHandlers ();
874- }
875- });
876- _AppendCloseMenuItems (contextMenuFlyout);
877- TabViewItem ().ContextFlyout (contextMenuFlyout);
854+ newTabFlyout.Items ().Append (chooseColorMenuItem);
855+ newTabFlyout.Items ().Append (renameTabMenuItem);
856+ newTabFlyout.Items ().Append (duplicateTabMenuItem);
857+ newTabFlyout.Items ().Append (menuSeparator);
858+ _AppendCloseMenuItems (newTabFlyout);
859+ TabViewItem ().ContextFlyout (newTabFlyout);
878860 }
879861
880862 // Method Description:
0 commit comments