Repository: flutter
Issue: [macOS] After creating a new window, the secondary window may not respond properly after switching to a different app and returning to the window
Labels: framework,platform-mac,a: desktop,has reproducible steps,P3,found in release: 3.13,found in release: 3.14,team-macos,triaged-macos

### Steps to reproduce

1. Use Mac mini / macOS Monterey 12.6.1
2. Run application and create new window
3. When I switch between applications and go back to the sub-window created by the application, the sub-window is directly unresponsive, and I catch any errors, and there are no errors
4. I tried other versions such as 3.7.7 and didn't have this problem

### Expected results

The create child window does not respond

### Actual results

You can click to operate, normal interaction

### Code sample

<details>
<summary>code sample</summary>

```dart
void main(List<String> args) {
  pdebug("@@@@@@@@@@@@ main start");
  if (args.isNotEmpty && args.first == 'multi_window') {
    final arguments = jsonDecode(args[2]);
    final key = arguments['key'];
    switch (key) {
      case 'setting':
        MultiWindowRunner.runMaterialApp(arguments, const SettingHome());
        break;
      case 'chat_history':
        MultiWindowRunner.runMaterialApp(
            arguments,
            ChatHistory(
              chatId: arguments['chat_id'],
              messageId: arguments['message_id'],
            ));
        break;
    }
    return;
  }

  profileDebug = showProfileDebug;
  runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    await FileDragAndDropChannel.instance.initializedMainView();
    objcetMgr.multiWindowMgr.windowInit();
    runApp(MyApp());
  }, (error, stackTrace) async {
    if (inProduction) {
      await postException(error, stackTrace, userID: objcetMgr.mainUser.id);
    }
  });
}



static void runMaterialApp(dynamic arguments, Widget child) {
    BotToastNavigatorObserver botToastNavigatorObserver =
        BotToastNavigatorObserver();
    pageMgr.register();
    runApp(
      MaterialApp(
        localizationsDelegates: const [
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
          GlobalCupertinoLocalizations.delegate,
        ],
        supportedLocales: const [Locale('zh', 'CN'), Locale('en')],
        debugShowCheckedModeBanner: false,
        builder: (context, widget) {
          return GestureDetector(
            onTap: () {
              FocusScopeNode currentFocus = FocusScope.of(context);
              if (!currentFocus.hasPrimaryFocus &&
                  currentFocus.focusedChild != null) {
                FocusManager.instance.primaryFocus?.unfocus();
              }
            },
            child: MediaQuery(
                data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
                child: BotToastInit()(context, widget)),
          );
        },
        title: appName,
        navigatorObservers: [
          botToastNavigatorObserver,
        ],
        home: ThemeContainer(mainUser: arguments['mainUser'], child: child),
        theme: themeData(),
      ),
    );
  }
```
</details>

### Flutter Doctor output
<details>
<summary> details</summary>

```
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel unknown, 3.7.9, on macOS 12.6.1 21G217 darwin-arm64, locale zh-Hans-CN)
    ! Flutter version 3.7.9 on channel unknown at /Users/melody/Desktop/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.81.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

! Doctor found issues in 2 categories.
```
</details>