window_manager icon indicating copy to clipboard operation
window_manager copied to clipboard

Not working maximum and minimum size for inital time in Linux

Open Abdulazeezvp opened this issue 1 year ago • 4 comments

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)

Abdulazeezvp avatar Jul 29 '22 11:07 Abdulazeezvp

  • 1
    working not in Linux

ilovesusu avatar Aug 20 '22 20:08 ilovesusu

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

animator avatar May 01 '23 10:05 animator

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

luiseduardobrito avatar Aug 15 '23 17:08 luiseduardobrito