From 01ef3746a2b0219135cab89480cdd4d91f4f95f7 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 27 Apr 2022 17:07:57 +0300 Subject: [PATCH] simple-egl: Add start as maximized Just like start as fullscreen, let us add a start as maximized as well. It tests out the maximized state and with clients geometry checks. Signed-off-by: Marius Vlad --- clients/simple-egl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clients/simple-egl.c b/clients/simple-egl.c index a0f418a5..4c3ad682 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -404,6 +404,8 @@ create_surface(struct window *window) if (window->fullscreen) xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL); + else if (window->maximized) + xdg_toplevel_set_maximized(window->xdg_toplevel); } static void @@ -806,6 +808,7 @@ usage(int error_code) fprintf(stderr, "Usage: simple-egl [OPTIONS]\n\n" " -d \tBuffer swap delay in microseconds\n" " -f\tRun in fullscreen mode\n" + " -m\tRun in maximized mode\n" " -o\tCreate an opaque surface\n" " -s\tUse a 16 bpp EGL config\n" " -b\tDon't sync to compositor redraw (eglSwapInterval 0)\n" @@ -836,6 +839,8 @@ main(int argc, char **argv) window.delay = atoi(argv[++i]); else if (strcmp("-f", argv[i]) == 0) window.fullscreen = 1; + else if (strcmp("-m", argv[i]) == 0) + window.maximized = 1; else if (strcmp("-o", argv[i]) == 0) window.opaque = 1; else if (strcmp("-s", argv[i]) == 0)