google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 607 forks source link

[window_size] Fix getWindowMinSize in Linux #848

Closed robert-ancell closed 3 years ago

robert-ancell commented 3 years ago

The GTK default is (-1, -1), which looks like Size(-1, -1) to Flutter. GTK uses -1 for requisition size (the size GTK has calculated), so we map that to (0, 0).

robert-ancell commented 3 years ago

This fixes the issue if you make a trivial Flutter app that does:

print(await window_size.getWindowMinSize());

You get:

Size(-1.0, -1.0)