Repository: microsoft/PowerToys
File: src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs (C#)

Code before:
                        OobeWindow scoobeWindow = new OobeWindow(OOBE.Enums.PowerToysModules.WhatsNew, isDark);
                        scoobeWindow.Activate();
                        scoobeWindow.ExtendsContentIntoTitleBar = true;
                        SetOobeWindow(scoobeWindow);
                    }
                    else if (ShowFlyout)
                    {
                        POINT? p = null;
                        if (containsFlyoutPosition)
                        {
                            p = new POINT(flyout_x, flyout_y);
                        }

                        ShellPage.OpenFlyoutCallback(p);
                    }
                }
            }
            else
            {
#if DEBUG
                // For debugging purposes
                // Window is also needed to show MessageDialog
                settingsWindow = new MainWindow(isDark);
                settingsWindow.ExtendsContentIntoTitleBar = true;
                settingsWindow.Activate();
                settingsWindow.NavigateToSection(StartupPage);
                ShowMessageDialog("The application is running in Debug mode.", "DEBUG");
#else
                SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.Overview, true);
                Exit();
#endif
            }
        }

#if !DEBUG
        private async void ShowMessageDialogAndExit(string content, string title = null)
#else
        private async void ShowMessageDialog(string content, string title = null)
#endif
        {
            await ShowDialogAsync(content, title);
#if !DEBUG
            this.Exit();
#endif
        }

        public static Task<IUICommand> ShowDialogAsync(string content, string title = null)
        {
            var dialog = new MessageDialog(content, title ?? string.Empty);
            var handle = NativeMethods.GetActiveWindow();
            if (handle == IntPtr.Zero)

Review comment (bug):
This line and the removed line below changes debug/no debug behavior and moves thing into debug case. Mistake?

Code after:
                        OobeWindow scoobeWindow = new OobeWindow(OOBE.Enums.PowerToysModules.WhatsNew, isDark);
                        scoobeWindow.Activate();
                        scoobeWindow.ExtendsContentIntoTitleBar = true;
                        SetOobeWindow(scoobeWindow);
                    }
                    else if (ShowFlyout)
                    {
                        POINT? p = null;
                        if (containsFlyoutPosition)
                        {
                            p = new POINT(flyout_x, flyout_y);
                        }

                        ShellPage.OpenFlyoutCallback(p);
                    }
                }
            }
            else
            {
#if DEBUG
                // For debugging purposes
                // Window is also needed to show MessageDialog
                settingsWindow = new MainWindow(isDark);
                settingsWindow.ExtendsContentIntoTitleBar = true;
                settingsWindow.Activate();
                settingsWindow.NavigateToSection(StartupPage);
                ShowMessageDialog("The application is running in Debug mode.", "DEBUG");
#else
                /* If we try to run Settings as a standalone app, it will start PowerToys.exe if not running and open Settings again through it in the General page. */
                SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.Overview, true);
                Exit();
#endif
            }
        }

#if !DEBUG
        private async void ShowMessageDialogAndExit(string content, string title = null)
#else
        private async void ShowMessageDialog(string content, string title = null)
#endif
        {
            await ShowDialogAsync(content, title);
#if !DEBUG
            this.Exit();
#endif
        }

        public static Task<IUICommand> ShowDialogAsync(string content, string title = null)
        {
            var dialog = new MessageDialog(content, title ?? string.Empty);
            var handle = NativeMethods.GetActiveWindow();