# HG changeset patch # User Olaf Wintermann # Date 1763905961 -3600 # Node ID 89118a9350dae3fad02f5dbb4ba4da4b0de8bac2 # Parent 70e14fa98ab4b2b3b0db9ca9efcd246cf50532f9 add ui_window_fullscreen (Motif) diff -r 70e14fa98ab4 -r 89118a9350da ui/motif/window.c --- a/ui/motif/window.c Sun Nov 23 11:21:17 2025 +0100 +++ b/ui/motif/window.c Sun Nov 23 14:52:41 2025 +0100 @@ -179,6 +179,32 @@ } } +static Atom net_wm_state; +static Atom net_wm_state_fullscreen; +static int net_wm_atoms_initialized = 0; + +void ui_window_fullscreen(UiObject *obj, UiBool fullscreen) { + Display *dpy = XtDisplay(obj->widget); + + // init net_wm_state atoms + if(!net_wm_atoms_initialized) { + net_wm_state = XInternAtom(dpy, "_NET_WM_STATE", False); + net_wm_state_fullscreen = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); + net_wm_atoms_initialized = 1; + } + + XEvent ev; + memset(&ev, 0, sizeof(XEvent)); + ev.type = ClientMessage; + ev.xclient.window = XtWindow(obj->widget); + ev.xclient.message_type = net_wm_state; + ev.xclient.format = 32; + ev.xclient.data.l[0] = fullscreen ? 1 : 0; + ev.xclient.data.l[1] = net_wm_state_fullscreen; + ev.xclient.data.l[2] = 0; + XSendEvent(dpy, DefaultRootWindow(dpy), False, SubstructureNotifyMask | SubstructureRedirectMask, &ev); +} + static void filedialog_event(UiEventData *event, int result, UiFileList flist) { UiEvent evt; evt.obj = event->obj; diff -r 70e14fa98ab4 -r 89118a9350da ui/ui/window.h --- a/ui/ui/window.h Sun Nov 23 11:21:17 2025 +0100 +++ b/ui/ui/window.h Sun Nov 23 14:52:41 2025 +0100 @@ -85,6 +85,8 @@ UIEXPORT void ui_window_default_size(int width, int height); UIEXPORT void ui_window_menubar_set_visible(UiObject *obj, UiBool visible); +UIEXPORT void ui_window_fullscreen(UiObject *obj, UiBool fullscreen); + UIEXPORT void ui_splitview_window_set_pos(UiObject *obj, int pos); UIEXPORT int ui_splitview_window_get_pos(UiObject *obj); UIEXPORT void ui_splitview_window_set_default_pos(int pos);