--- a/ui/motif/window.c Sun Nov 23 10:23:10 2025 +0100 +++ b/ui/motif/window.c Sun Nov 23 10:39:51 2025 +0100 @@ -32,13 +32,15 @@ #include <limits.h> #include <unistd.h> +#include "window.h" + #include "toolkit.h" #include "menu.h" #include "toolbar.h" #include "container.h" #include "pathbar.h" -#include "../ui/window.h" #include "../common/context.h" +#include "../common/utils.h" #include "Grid.h" #include "Fsb.h" @@ -79,13 +81,19 @@ obj->window = window_data; obj->destroy = ui_window_widget_destroy; + int window_width = window_default_width; + int window_height = window_default_height; + if(!simple) { + ui_get_window_default_width(&window_width, &window_height); + } + Arg args[16]; int n = 0; XtSetArg(args[n], XmNtitle, title); n++; XtSetArg(args[n], XmNminWidth, 100); n++; XtSetArg(args[n], XmNminHeight, 50); n++; - XtSetArg(args[n], XmNwidth, window_default_width); n++; - XtSetArg(args[n], XmNheight, window_default_height); n++; + XtSetArg(args[n], XmNwidth, window_width); n++; + XtSetArg(args[n], XmNheight, window_height); n++; Widget toplevel = XtAppCreateShell( ui_appname(), @@ -148,6 +156,19 @@ return create_window(title, window_data, TRUE); } +void ui_window_size(UiObject *obj, int width, int height) { + XtVaSetValues(obj->widget, XmNwidth, width, XmNheight, height, NULL); +} + +void ui_window_default_size(int width, int height) { + window_default_width = width; + window_default_height = height; +} + +void ui_window_menubar_set_visible(UiObject *obj, UiBool visible) { + +} + static void filedialog_event(UiEventData *event, int result, UiFileList flist) { UiEvent evt; evt.obj = event->obj;