leanflutter / window_manager

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

Not working maximum and minimum size for inital time in Linux #189

Open Abdulazeezvp opened 2 years ago

Abdulazeezvp commented 2 years ago

for Linux desktop application, setMaximumSize and setMinimumSize not applying while building the app, if hot reload is performed the it is working as expected. setAsFrameless is working which is added along with maximum and minimum function.

initial time:

 setWindow() async {
    if (Platform.isWindows || Platform.isLinux) {
      await windowManager.ensureInitialized();
      windowManager
          .setPosition(Offset(1519, Platform.isWindows ? 478.5 : 518.5)); ///working
      windowManager.setMaximumSize(const Size(380, 540));///not working
      windowManager.setMinimumSize(const Size(380, 540));///not working

      windowManager.setAsFrameless();///working
    }
  }

///if a reload is performed, all working as expected.

calling from main.dart initState working in windows but not in Linux(using ubuntu 22.04 LTS)

ilovesusu commented 2 years ago
animator commented 1 year ago

+1 observed the same. Any plans to fix this issue?

luiseduardobrito commented 1 year ago

I was able to fix it directly in the GTK code in linux/my_application.cc adding:

gtk_widget_set_size_request(GTK_WIDGET(window), 800, 600);

Reference: https://docs.gtk.org/gtk3/method.Widget.set_size_request.html

xlfdyzcs commented 6 months ago

+1