leanflutter / window_manager

This plugin allows Flutter desktop apps to resizing and repositioning the window.
https://pub.dev/packages/window_manager
MIT License
724 stars 205 forks source link

[Linux]The example code runs without displaying a window after compilation. #492

Open dongfengweixiao opened 3 months ago

dongfengweixiao commented 3 months ago

When the compiled target file is run, the terminal does not print any error messages, but the application window does not appear.

➜  example git:(main) ✗ flutter run -d linux
Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                           
✓ Built build/linux/x64/debug/bundle/window_manager_example

flutter doctor:

  example git:(main) ✗ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on Arch Linux 6.10.6-zen1-1-zen, locale zh_CN.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.1)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!
Pedro-Guilherme commented 3 days ago

Hi,

I found a way to make that work on flutter 3.24.3

  1. Dont follow the intructions described on readme for the file "linux/my_application.cc"
  2. Make sure the variable "use_header_bar" on file "linux/my_application.cc" is FALSE
  3. Dont set any size for you window. Ex.: gtk_window_set_default_size(window, 0, 0);

It will works for me on PopOS 22.04...