@@ -66,6 +66,12 @@ struct ModalHostView : public winrt::implements<ModalHostView, winrt::Windows::F
6666 m_appWindow = nullptr ;
6767 }
6868
69+ // Bring parent window to foreground
70+ if (m_parentHwnd) {
71+ SetForegroundWindow (m_parentHwnd);
72+ SetFocus (m_parentHwnd);
73+ }
74+
6975 // Close bridge
7076 m_popUp.Close ();
7177 m_popUp = nullptr ;
@@ -247,6 +253,12 @@ struct ModalHostView : public winrt::implements<ModalHostView, winrt::Windows::F
247253 m_reactContext.Properties ().Handle (), m_prevWindowID);
248254 }
249255
256+ // Bring parent window to foreground
257+ if (m_parentHwnd) {
258+ SetForegroundWindow (m_parentHwnd);
259+ SetFocus (m_parentHwnd);
260+ }
261+
250262 // Dispatch onDismiss event
251263 if (auto eventEmitter = EventEmitter ()) {
252264 ::Microsoft::ReactNativeSpecs::ModalHostViewEventEmitter::OnDismiss eventArgs;
@@ -287,9 +299,16 @@ struct ModalHostView : public winrt::implements<ModalHostView, winrt::Windows::F
287299 overlappedPresenter.IsModal (true );
288300 overlappedPresenter.SetBorderAndTitleBar (true , true );
289301
302+ // modal should only have close button
303+ overlappedPresenter.IsMinimizable (false );
304+ overlappedPresenter.IsMaximizable (false );
305+
290306 // Apply the presenter to the window
291307 m_appWindow.SetPresenter (overlappedPresenter);
292308
309+ // Hide the title bar icon
310+ m_appWindow.TitleBar ().IconShowOptions (winrt::Microsoft::UI::Windowing::IconShowOptions::HideIconAndSystemMenu);
311+
293312 // Set initial title using the stored local props
294313 if (m_localProps && m_localProps->title .has_value ()) {
295314 winrt::hstring titleValue = winrt::to_hstring (m_localProps->title .value ());
0 commit comments