neuswc

patched neuswc library (tracked)
git clone https://git.daat.foo/neuswc.git
Log | Files | Refs | README | LICENSE

commit 3ff79437aa4fccf584adbd245b0f51771295b20e
parent ee6d5a8f894de506330f3d58766b9d54b2d03502
Author: dalem <lain@dalem.foo>
Date:   Tue, 27 Jan 2026 17:36:27 +0100

add fullscreen support

Diffstat:
Mlibswc/window.c | 21++++++++++++++++-----
Mlibswc/window.h | 5+++++
2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/libswc/window.c b/libswc/window.c @@ -194,12 +194,23 @@ EXPORT void swc_window_set_fullscreen(struct swc_window *base, struct swc_screen *screen) { struct window *window = INTERNAL(base); + struct swc_rectangle geom; + swc_window_get_geometry(base, &geom); + + if (window->mode != WINDOW_MODE_FULLSCREEN) { + window->prev.geom = geom; + window->prev.mode = window->mode; + swc_window_set_geometry(base, &screen->usable_geometry); + + if (window->impl->set_mode) + window->impl->set_mode(window, WINDOW_MODE_FULLSCREEN); + window->mode = WINDOW_MODE_FULLSCREEN; + } - /* TODO: Implement fullscreen windows. */ - - if (window->impl->set_mode) - window->impl->set_mode(window, WINDOW_MODE_FULLSCREEN); - window->mode = WINDOW_MODE_FULLSCREEN; + else { + swc_window_set_geometry(base, &window->prev.geom); + window->mode = window->prev.mode; + } } EXPORT void diff --git a/libswc/window.h b/libswc/window.h @@ -52,6 +52,11 @@ struct window { struct view_handler view_handler; bool managed; unsigned mode; + + struct { + struct swc_rectangle geom; + unsigned mode; + } prev; struct { struct window_pointer_interaction interaction;