window_manager
window_manager copied to clipboard
Not working maximum and minimum size for inital time in Linux
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)
- 1
working not in Linux
+1 observed the same. Any plans to fix this issue?
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