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

Unhandled Exception: mainWindow not found #30

Open
LiveRock opened this issue Jul 22, 2021 · 4 comments
Open

Unhandled Exception: mainWindow not found #30

LiveRock opened this issue Jul 22, 2021 · 4 comments

Comments

@LiveRock
Copy link

LiveRock commented Jul 22, 2021

Can't set app to full screen using the following command:

await DesktopWindow.setFullScreen(true);

Error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: mainWindow not found
#0      DesktopWindow.getWindowSize (package:desktop_window/desktop_window.dart:16:5)
<asynchronous suspension> 

Environment:
MacOS 11.4 Big Sur
Mac Mini M1

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)

What could I have done wrong?

@colatea
Copy link

colatea commented Aug 16, 2021

I have the same problem。

flutter: getWindowSize err: PlatformException(MAINWINDOW_NOT_FOUND, GtkWindow not found, null, null), #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18) <asynchronous suspension> #2 DesktopWindow.getWindowSize (package:desktop_window/desktop_window.dart:12:17) <asynchronous suspension> #3 FutureExtensions.onError.<anonymous closure> (dart:async/future.dart) <asynchronous suspension>
Environment:
OS: Manjaro Linux x86_64
Kernel: 5.10.56-1-MANJARO

@hyungtaecf
Copy link

hyungtaecf commented Mar 26, 2022

I got the same problem with the function setMinWindowSize. It was working before, but today it was not working a few times but not logging any error to the console. So I made a print of the result of the function and it says "mainWindow not found".

I'm using MacOS and I call the function before the runApp. The problem seems to happen when the program opens while I am full-screen using the IDE or other screen that is not the desktop where the app opens.

@PhysicalRevelry
Copy link

I have the same occurrence pattern as @hyungtaecf Everything runs fine as long as I keep my computer's focus on where the desktop simulator open.

Using MacOS, Flutter 2.13, beta channel

@hi-jin
Copy link

hi-jin commented May 7, 2024

PR #33 will help you guys.
I also forked this repo, changed code like PR did, and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants