ui/cocoa/window.m

changeset 1176
87a906a990e3
parent 1175
1943f7411e50
--- a/ui/cocoa/window.m	Sat Jun 06 18:08:51 2026 +0200
+++ b/ui/cocoa/window.m	Sat Jun 06 18:37:04 2026 +0200
@@ -41,6 +41,7 @@
 #include "../common/menu.h"
 #include "../common/toolbar.h"
 #include "../common/object.h"
+#include "../common/utils.h"
 
 #include <cx/mempool.h>
 
@@ -52,13 +53,20 @@
 
 static void main_window_destroy(UiObject *obj) {
     MainWindow *window = (__bridge MainWindow*)obj->wobj;
+    [window saveWindowSize];
     [[WindowManager sharedWindowManager] closeWindow:window];
 }
 
 static UiObject* create_window(const char *title, BOOL simple, BOOL sidebar, BOOL splitview) {
     UiObject *obj = uic_object_new_toplevel();
     
-    MainWindow *window = [[MainWindow alloc] init:obj withSidebar:sidebar withSplitview:splitview];
+    int width = window_default_width;
+    int height = window_default_height;
+    if(!simple) {
+       ui_get_window_default_width(&width, &height);
+   }
+    
+    MainWindow *window = [[MainWindow alloc] init:obj withSidebar:sidebar withSplitview:splitview width:width height:height];
     
     obj->wobj = (__bridge void*)window;
     obj->destroy = main_window_destroy;

mercurial