Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wayback for openSUSE:Factory checked 
in at 2025-12-26 14:37:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wayback (Old)
 and      /work/SRC/openSUSE:Factory/.wayback.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wayback"

Fri Dec 26 14:37:35 2025 rev:2 rq:1324410 version:0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/wayback/wayback.changes  2025-07-25 
17:06:06.183226635 +0200
+++ /work/SRC/openSUSE:Factory/.wayback.new.1928/wayback.changes        
2025-12-26 14:37:39.162802371 +0100
@@ -1,0 +2,8 @@
+Thu Dec 25 21:50:17 UTC 2025 - Jan Engelhardt <[email protected]>
+
+- Update to release 0.3
+  * Manual pages updated
+  * Overhaul of the custom command line option parser to handle
+    more X.org server options (such as ``vtXX``)
+
+-------------------------------------------------------------------

Old:
----
  wayback-0.1.tar.gz

New:
----
  wayback-0.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ wayback.spec ++++++
--- /var/tmp/diff_new_pack.aPQBRf/_old  2025-12-26 14:37:41.118882775 +0100
+++ /var/tmp/diff_new_pack.aPQBRf/_new  2025-12-26 14:37:41.134883432 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package wayback
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           wayback
-Version:        0.1
+Version:        0.3
 Release:        0
 Summary:        Experimental X11 compatibility layer for Wayland
 License:        MIT
@@ -27,21 +27,24 @@
 BuildRequires:  c++_compiler
 BuildRequires:  meson
 BuildRequires:  pkg-config
+BuildRequires:  wlroots-devel >= 0.19
 BuildRequires:  pkgconfig(wayland-client)
-BuildRequires:  pkgconfig(wayland-server)
-BuildRequires:  pkgconfig(wayland-egl)
 BuildRequires:  pkgconfig(wayland-cursor)
+BuildRequires:  pkgconfig(wayland-egl)
+BuildRequires:  pkgconfig(wayland-protocols) >= 1.14
+BuildRequires:  pkgconfig(wayland-server)
 BuildRequires:  pkgconfig(xkbcommon)
 BuildRequires:  pkgconfig(xwayland)
-BuildRequires:  pkgconfig(wayland-protocols) >= 1.14
-BuildRequires:  wlroots-devel >= 0.19
 Requires:       xwayland
 
 %description
 Wayback is an experimental X compatibility layer which allows for
 running full X desktop environments using Wayland components. It is
 essentially a stub compositor which provides just enough Wayland
-capabilities to host a rootful Xwayland server.
+capabilities to host a rootful Xwayland server (no other Wayland
+applications).
+
+# same echoed by https://lwn.net/Articles/1031332/
 
 %prep
 %autosetup -p1

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.aPQBRf/_old  2025-12-26 14:37:41.470897244 +0100
+++ /var/tmp/diff_new_pack.aPQBRf/_new  2025-12-26 14:37:41.522899382 +0100
@@ -1,5 +1,5 @@
-mtime: 1753398987
-commit: 0e01f6593aa3a8cd6759263df03ed88655a2e68f53b1c2db7f93a7349acc05c3
+mtime: 1766699508
+commit: 1d0a4c7d22dfaf98e2c1caedd2f7dc156f254425dca05bcbd57d7145c64342f1
 url: https://src.opensuse.org/jengelh/wayback
 revision: master
 

++++++ wayback-0.1.tar.gz -> wayback-0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/README.md new/wayback-0.3/README.md
--- old/wayback-0.1/README.md   2025-07-23 19:14:21.000000000 +0200
+++ new/wayback-0.3/README.md   2025-12-16 19:15:27.000000000 +0100
@@ -46,18 +46,23 @@
 issues we ask you to replicate them on the git `main` branch to make sure they
 are still applicable to the latest code.***
 
-- Alpine Linux edge: [`wayback` and `wayback-doc`][alpine-pkg] in the 
`testing` 
-  repository
+- Alpine Linux: [`wayback`][alpine-pkg] (in `community` repo)
 - ALT Linux: [`wayback`][alt-pkg]
 - Arch Linux: [`wayback-x11-git`][aur-pkg] in the AUR
 - Fedora Linux: [`wayback`][fedora-pkg]
+- Gentoo GURU: [`gui-wm/wayback`][gentoo-guru]
+- Nixpkgs: [`wayback-x11`][nixpkgs-pkg]
 - T2 SDE: [`wayback`][t2sde-pkg]
 
-[alpine-pkg]: 
https://pkgs.alpinelinux.org/packages?name=wayback*&branch=edge&repo=&arch=&origin=&flagged=&maintainer=
-[alt-pkg]:    https://packages.altlinux.org/en/sisyphus/srpms/wayback/
-[aur-pkg]:    https://aur.archlinux.org/packages/wayback-x11-git
+<!-- Keep sorted by link identifier, and then same order above -->
+
+[alpine-pkg]: 
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/wayback
+[alt-pkg]: https://packages.altlinux.org/en/sisyphus/srpms/wayback/
+[aur-pkg]: https://aur.archlinux.org/packages/wayback-x11-git
 [fedora-pkg]: https://src.fedoraproject.org/rpms/wayback
-[t2sde-pkg]:  https://t2sde.org/packages/wayback
+[gentoo-guru]: 
https://wiki.gentoo.org/wiki/Project:GURU/Information_for_End_Users
+[nixpkgs-pkg]: 
https://search.nixos.org/packages?channel=unstable&show=wayback-x11
+[t2sde-pkg]: https://t2sde.org/packages/wayback
 
 ## Discussion
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/common/optparse.c 
new/wayback-0.3/common/optparse.c
--- old/wayback-0.1/common/optparse.c   2025-07-23 19:14:21.000000000 +0200
+++ new/wayback-0.3/common/optparse.c   2025-12-16 19:15:27.000000000 +0100
@@ -15,26 +15,61 @@
 #include <string.h>
 #include <unistd.h>
 
-int optind = 0, optpos = 0;
+int optind = 0, optpos = 0, optoper = 0;
 
 int optparse(int argc, char *argv[], const struct optcmd opts[], uint32_t 
optlen)
 {
        optpos++;
+       optpos += optoper;
+       optoper = 0;
        if (optpos >= argc || !argv[optpos]) {
                return -1;
        }
        for (uint32_t i = 0; i < optlen; i++) {
-               if (strcmp(argv[optpos], opts[i].name) == 0) {
-                       if ((opts[i].req_operand) && (((optpos + 1) >= argc || 
!argv[optpos + 1]))) {
+               /* help message */
+               if (strcmp(argv[optpos], "-help") == 0) {
+                       wayback_log(LOG_INFO,
+                                   "Wayback <https://wayback.freedesktop.org/> 
X.Org compatibility layer");
+                       wayback_log(
+                               LOG_INFO,
+                               "Report bugs to 
<https://gitlab.freedesktop.org/wayback/wayback/-/issues>.");
+                       wayback_log(LOG_INFO, "Usage: %s [option]", argv[0]);
+                       wayback_log(LOG_INFO, "\t-help\t\t show this help 
message");
+                       for (size_t j = 0; j < optlen; j++) {
+                               if (!opts[j].ignore) {
+                                       wayback_log(LOG_INFO,
+                                                   "\t%s%s\t\t %s",
+                                                   opts[j].name,
+                                                   opts[j].flag == OPT_OPERAND 
? " opt" : "",
+                                                   opts[j].description);
+                               }
+                       }
+                       exit(EXIT_SUCCESS);
+               } else if (strcmp(argv[optpos], opts[i].name) == 0) {
+                       if (((opts[i].flag == OPT_OPERAND) && (((optpos + 1) >= 
argc || !argv[optpos + 1]))) ||
+                           opts[i].flag == OPT_NUM) {
                                wayback_log(LOG_ERROR, "Option %s requires 
operand", argv[optpos]);
                                exit(EXIT_FAILURE);
                        } else if (opts[i].ignore == true) {
-                               wayback_log(LOG_WARN, "Option %s ignored", 
argv[optpos]);
+                               if (strcmp(opts[i].description, "") != 0)
+                                       wayback_log(LOG_WARN, "%s: %s", 
argv[optpos], opts[i].description);
+                               else
+                                       wayback_log(LOG_WARN, "Option %s 
ignored", argv[optpos]);
                        }
 
-                       if (opts[i].req_operand) {
+                       if (opts[i].flag == OPT_OPERAND) {
                                optind++;
-                               optpos++;
+                               optoper++;
+                       }
+                       optind++;
+                       break;
+               } else if (opts[i].flag == OPT_NUM &&
+                          strncmp(argv[optpos], opts[i].name, 
strlen(opts[i].name)) == 0) {
+                       if (opts[i].ignore == true) {
+                               if (strcmp(opts[i].description, "") != 0)
+                                       wayback_log(LOG_WARN, "%s: %s", 
argv[optpos], opts[i].description);
+                               else
+                                       wayback_log(LOG_WARN, "Option %s 
ignored", argv[optpos]);
                        }
                        optind++;
                        break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/common/optparse.h 
new/wayback-0.3/common/optparse.h
--- old/wayback-0.1/common/optparse.h   2025-07-23 19:14:21.000000000 +0200
+++ new/wayback-0.3/common/optparse.h   2025-12-16 19:15:27.000000000 +0100
@@ -13,16 +13,23 @@
 #include <string.h>
 #include <unistd.h>
 
+enum optparse_flags
+{
+       OPT_OPERAND, /* option requires an operand, e.g. -opt thing */
+       OPT_NUM,     /* option requires a max. 2 digit operand, e.g. vtXX */
+       OPT_NOFLAG,  /* no operands at all, e.g. -opt */
+};
+
 struct optcmd
 {
        const char *name;
        const char *description;
-       const bool req_operand;
+       const enum optparse_flags flag;
        const bool ignore;
 };
 
-#define IGNORE_OPT(s, req_op)                                                  
                    \
-       { .name = s, .description = "", .req_operand = req_op, .ignore = true }
+#define IGNORE_OPT_DESC(s, f, d) { .name = s, .description = d, .flag = f, 
.ignore = true }
+#define IGNORE_OPT(s, f) IGNORE_OPT_DESC(s, f, "")
 
 int optparse(int argc, char *argv[], const struct optcmd opts[], uint32_t 
optlen);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/doc/Xwayback.scdoc 
new/wayback-0.3/doc/Xwayback.scdoc
--- old/wayback-0.1/doc/Xwayback.scdoc  2025-07-23 19:14:21.000000000 +0200
+++ new/wayback-0.3/doc/Xwayback.scdoc  2025-12-16 19:15:27.000000000 +0100
@@ -6,7 +6,7 @@
 
 # SYNOPSIS
 
-*Xwayback* _args_
+*Xwayback* :_display_ _args_
 
 # DESCRIPTION
 
@@ -14,8 +14,15 @@
 
 # OPTIONS
 
-       *-d*, *--display* _<display>_
-               Launch Xwayback on the specified display number
+*Xwayback* accepts all flags *Xorg*(1) accepts.  However, some options are 
stubs.
+
+Additionally, *Xwayback* supports the following:
+
+       *-help*
+               Show help page
+
+       *-version*, *-showconfig*
+               Show Xwayback version
 
 # ENVVARS
 
@@ -34,4 +41,4 @@
 
 # SEE ALSO
 
-*wayback-session*(1), *Xserver(1)*, *Xorg(1)*, *Xwayland*(1)
+*wayback-session*(1), *Xserver*(1), *Xorg*(1), *Xwayland*(1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/doc/wayback-session.scdoc 
new/wayback-0.3/doc/wayback-session.scdoc
--- old/wayback-0.1/doc/wayback-session.scdoc   2025-07-23 19:14:21.000000000 
+0200
+++ new/wayback-0.3/doc/wayback-session.scdoc   2025-12-16 19:15:27.000000000 
+0100
@@ -6,7 +6,7 @@
 
 # SYNOPSIS
 
-*wayback-session* _session cmd_
+*wayback-session* _-sesscmd sessioncmd_ _args_
 
 # DESCRIPTION
 
@@ -17,7 +17,16 @@
 
 *wayback-session* optionally takes the command to launch a session.
 If no command is specified it will try to launch ~/.xinitrc.
-If ~/.xinitrc is not found, it will launch /etc/X11/xinit/xinitrc
+If ~/.xinitrc is not found, it will launch /etc/X11/xinit/xinitrc.
+
+       *-help*
+               Show help page
+
+       *-sesscmd*
+               Path to session command
+
+       *-version*, *-showconfig*
+               Show wayback-session version
 
 # ENVVARS
 
@@ -26,10 +35,14 @@
 
 For other supported environment variables, see *Xwayback*(1) (section 
*ENVVARS*).
 
+# FUTURE DIRECTIONS
+
+This command will be deprecated and replaced by *xinit*(1) in the future.
+
 # LICENSE
 
 MIT
 
 # SEE ALSO
 
-*Xwayback*(1), *startx*(1), *Xserver(1)*, *Xorg(1)*
+*Xwayback*(1), *startx*(1), *Xserver*(1), *Xorg*(1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/meson.build new/wayback-0.3/meson.build
--- old/wayback-0.1/meson.build 2025-07-23 19:14:21.000000000 +0200
+++ new/wayback-0.3/meson.build 2025-12-16 19:15:27.000000000 +0100
@@ -1,5 +1,5 @@
 project('wayback', 'c',
-  version: '0.1',
+  version: '0.3',
   license: 'MIT',
   meson_version: '>= 1.4.0',
   default_options: [
@@ -13,6 +13,7 @@
 add_project_arguments('-DWLR_USE_UNSTABLE', language: 'c')
 
 
add_global_arguments('-DWAYBACK_COMPOSITOR_EXEC_PATH="@0@/wayback-compositor"'.format(get_option('prefix')
 /get_option('libexecdir')), language : 'c')
+add_global_arguments('-DWAYBACK_VERSION="@0@"'.format(meson.project_version()),
 language : 'c')
 
 wayland_server = dependency('wayland-server')
 wayland_client = dependency('wayland-client')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/wayback-compositor/wayback-compositor.c 
new/wayback-0.3/wayback-compositor/wayback-compositor.c
--- old/wayback-0.1/wayback-compositor/wayback-compositor.c     2025-07-23 
19:14:21.000000000 +0200
+++ new/wayback-0.3/wayback-compositor/wayback-compositor.c     2025-12-16 
19:15:27.000000000 +0100
@@ -125,6 +125,12 @@
        struct wl_listener destroy;
 };
 
+struct wayback_client
+{
+       struct tinywl_server *server;
+       struct wl_listener destroy;
+};
+
 static void keyboard_handle_modifiers(struct wl_listener *listener, void *data)
 {
        /* This event is raised when a modifier key, such as shift or alt, is
@@ -307,6 +313,13 @@
        wlr_seat_set_selection(server->seat, event->source, event->serial);
 }
 
+static void client_destroy(struct wl_listener *listener, void *data)
+{
+       struct wayback_client *client = wl_container_of(listener, client, 
destroy);
+
+       wl_display_terminate(client->server->wl_display);
+}
+
 static struct tinywl_toplevel *desktop_toplevel_at(struct tinywl_server 
*server,
                                                    double lx,
                                                    double ly,
@@ -776,6 +789,9 @@
        wayback_log_init("wayback-compositor", LOG_INFO, wayback_wlr_vlog);
 
        if (argc < 3) {
+               wayback_log(LOG_INFO,
+                           "Wayback <https://wayback.freedesktop.org/> X.Org 
compatibility layer");
+               wayback_log(LOG_INFO, "Version %s", WAYBACK_VERSION);
                wayback_log(LOG_INFO, "Usage: %s <socket xwayback> <socket 
xwayland>", argv[0]);
                exit(EXIT_FAILURE);
        }
@@ -916,17 +932,32 @@
 
        /* Add a Unix socket to the Wayland display. */
        set_cloexec(xwayback_session_socket);
-       if (!wl_client_create(server.wl_display, xwayback_session_socket)) {
+       struct wl_client *xwayback_client =
+               wl_client_create(server.wl_display, xwayback_session_socket);
+
+       if (!xwayback_client) {
                wlr_log(WLR_ERROR, "Failed to connect to xwayback client");
                exit(EXIT_FAILURE);
        }
 
-       set_cloexec(xwayback_session_socket);
-       if (!wl_client_create(server.wl_display, xwayland_session_socket)) {
+       struct wayback_client xwayback = { 0 };
+       xwayback.server = &server;
+       xwayback.destroy.notify = client_destroy;
+       wl_client_add_destroy_listener(xwayback_client, &xwayback.destroy);
+
+       set_cloexec(xwayland_session_socket);
+       struct wl_client *xwayland_client =
+               wl_client_create(server.wl_display, xwayland_session_socket);
+       if (!xwayland_client) {
                wlr_log(WLR_ERROR, "Failed to connect to xwayland client");
                exit(EXIT_FAILURE);
        }
 
+       struct wayback_client xwayland = { 0 };
+       xwayland.server = &server;
+       xwayland.destroy.notify = client_destroy;
+       wl_client_add_destroy_listener(xwayland_client, &xwayland.destroy);
+
        /* Start the backend. This will enumerate outputs and inputs, become 
the DRM
         * master, etc */
        if (!wlr_backend_start(server.backend)) {
@@ -978,6 +1009,9 @@
 
        wl_list_remove(&server.new_output.link);
 
+       wl_list_remove(&server.new_xdg_toplevel.link);
+       wl_list_remove(&server.new_xdg_popup.link);
+
        wlr_scene_node_destroy(&server.scene->tree.node);
        wlr_xcursor_manager_destroy(server.cursor_mgr);
        wlr_cursor_destroy(server.cursor);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/wayback-session/wayback-session.c 
new/wayback-0.3/wayback-session/wayback-session.c
--- old/wayback-0.1/wayback-session/wayback-session.c   2025-07-23 
19:14:21.000000000 +0200
+++ new/wayback-0.3/wayback-session/wayback-session.c   2025-12-16 
19:15:27.000000000 +0100
@@ -5,6 +5,7 @@
  * SPDX-License-Identifier: MIT
  */
 
+#include "optparse.h"
 #include "utils.h"
 #include "wayback_log.h"
 
@@ -59,12 +60,42 @@
 
        char **session_cmd = NULL;
        char *xinitrc_path = NULL;
+       const struct optcmd opts[] = {
+               { .name = "-sesscmd",
+                 .description = "run custom session command",
+                 .flag = OPT_NOFLAG,
+                 .ignore = false },
+               { .name = "-showconfig",
+                 .description = "alias to -version",
+                 .flag = OPT_NOFLAG,
+                 .ignore = false },
+               { .name = "-version",
+                 .description = "show wayback-session version",
+                 .flag = OPT_NOFLAG,
+                 .ignore = false },
+       };
        signal(SIGCHLD, handle_child_exit);
 
-       if (argc == 1) {
+       int cur_opt = 0;
+       while (cur_opt = optparse(argc, argv, opts, ARRAY_SIZE(opts)), cur_opt 
!= -1) {
+               if (strcmp(argv[cur_opt], "-version") == 0 || 
strcmp(argv[cur_opt], "-showconfig") == 0) {
+                       wayback_log(LOG_INFO,
+                                   "Wayback <https://wayback.freedesktop.org/> 
X.Org compatibility layer");
+                       wayback_log(LOG_INFO, "Version %s", WAYBACK_VERSION);
+                       exit(EXIT_SUCCESS);
+               } else if (strcmp(argv[cur_opt], "-sesscmd") == 0) {
+                       session_cmd = &argv[cur_opt + 1];
+               } else {
+                       wayback_log(LOG_ERROR, "Unknown option %s", 
argv[cur_opt]);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if ((argc - optind) <= 0) {
+               wayback_log(LOG_ERROR, "Argument count is <= 0");
+       }
+       if (!session_cmd) {
                xinitrc_path = get_xinitrc_path();
-       } else {
-               session_cmd = &argv[optind];
        }
 
        char *xwayback_path = getenv("XWAYBACK_PATH");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wayback-0.1/xwayback/xwayback.c 
new/wayback-0.3/xwayback/xwayback.c
--- old/wayback-0.1/xwayback/xwayback.c 2025-07-23 19:14:21.000000000 +0200
+++ new/wayback-0.3/xwayback/xwayback.c 2025-12-16 19:15:27.000000000 +0100
@@ -209,24 +209,6 @@
        .global_remove = NULL, // TODO: handle_global_remove
 };
 
-static void handle_child_exit(int sig)
-{
-       pid_t pid = waitpid(-1, NULL, WNOHANG);
-       if (pid == comp_pid || pid == xway_pid) {
-               if (pid == comp_pid && xway_pid > 0)
-                       kill(xway_pid, SIGTERM);
-               if (pid == xway_pid && comp_pid > 0)
-                       kill(comp_pid, SIGTERM);
-               exit(EXIT_SUCCESS);
-       }
-}
-
-static void handle_exit(int sig)
-{
-       kill(xway_pid, SIGTERM);
-       kill(comp_pid, SIGTERM);
-}
-
 static void handle_segv(int sig)
 {
        const char *errormsg =
@@ -236,7 +218,6 @@
                "steps\nto reproduce this error.  If you need assistance, join 
#wayback on Libera.Chat\nor "
                "#wayback:catircservices.org on Matrix.\n";
        write(STDERR_FILENO, errormsg, strlen(errormsg));
-       handle_exit(sig);
 }
 
 extern char **environ;
@@ -246,100 +227,83 @@
        struct xwayback *xwayback = malloc(sizeof(struct xwayback));
        const struct optcmd opts[] = {
                /* options handled by Xwayback */
-               { .name = "-help", .description = "show help page", 
.req_operand = false, .ignore = false },
                { .name = "-showconfig",
                  .description = "alias to -version",
-                 .req_operand = false,
+                 .flag = OPT_NOFLAG,
                  .ignore = false },
                { .name = "-version",
                  .description = "show Xwayback version",
-                 .req_operand = false,
+                 .flag = OPT_NOFLAG,
+                 .ignore = false },
+               { .name = "-novtswitch",
+                 .description = "do not switch VTs on startup (default)",
+                 .flag = OPT_NOFLAG,
                  .ignore = false },
 
                /* ignored options */
-               IGNORE_OPT("-decorate", false),
-               IGNORE_OPT("-enable‐ei‐portal", false),
-               IGNORE_OPT("-fullscreen", false),
-               IGNORE_OPT("-geometry", true),
-               IGNORE_OPT("-glamor", true),
-               IGNORE_OPT("-hidpi", false),
-               IGNORE_OPT("-host‐grab", false),
-               IGNORE_OPT("-noTouchPointerEmulation", false),
-               IGNORE_OPT("-force‐xrandr‐emulation", false),
-               IGNORE_OPT("-nokeymap", false),
-               IGNORE_OPT("-rootless", false),
-               IGNORE_OPT("-shm", false),
-               IGNORE_OPT("-wm", true),
+               IGNORE_OPT("-decorate", OPT_NOFLAG),
+               IGNORE_OPT("-enable‐ei‐portal", OPT_NOFLAG),
+               IGNORE_OPT("-fullscreen", OPT_NOFLAG),
+               IGNORE_OPT("-geometry", OPT_OPERAND),
+               IGNORE_OPT("-glamor", OPT_OPERAND),
+               IGNORE_OPT("-hidpi", OPT_NOFLAG),
+               IGNORE_OPT("-host‐grab", OPT_NOFLAG),
+               IGNORE_OPT("-noTouchPointerEmulation", OPT_NOFLAG),
+               IGNORE_OPT("-force‐xrandr‐emulation", OPT_NOFLAG),
+               IGNORE_OPT("-nokeymap", OPT_NOFLAG),
+               IGNORE_OPT("-rootless", OPT_NOFLAG),
+               IGNORE_OPT("-shm", OPT_NOFLAG),
+               IGNORE_OPT("-wm", OPT_OPERAND),
+               IGNORE_OPT_DESC(
+                       "vt", OPT_NUM, "VT switching is not supported; behaving 
as if -novtswitch is passed"),
 
                /* Xorg(1)-specific options */
-               IGNORE_OPT("-allowMouseOpenFail", false),
-               IGNORE_OPT("-allowNonLocalXvidtune", false),
-               IGNORE_OPT("-bgamma", true),
-               IGNORE_OPT("-bpp", true), /* no longer supported by upstream 
Xorg(1) */
-               IGNORE_OPT("-config", true),
-               IGNORE_OPT("-configdir", true),
-               IGNORE_OPT("-configure", true),
-               IGNORE_OPT("-crt", true),
-               IGNORE_OPT("-depth", true),
-               IGNORE_OPT("-disableVidMode", false),
-               IGNORE_OPT("-fbbbp", true),
-               IGNORE_OPT("-gamma", true),
-               IGNORE_OPT("-ggamma", true),
-               IGNORE_OPT("-ignoreABI", false),
-               IGNORE_OPT("-isolateDevice", true),
-               IGNORE_OPT("-keeptty", false),
-               IGNORE_OPT("-keyboard", true),
-               IGNORE_OPT("-layout", true),
-               IGNORE_OPT("-logverbose", true),
-               IGNORE_OPT("-modulepath", true),
-               IGNORE_OPT("-noautoBindCPU", false),
-               IGNORE_OPT("-nosilk", false),
-               IGNORE_OPT("-novtswitch", false),
-               IGNORE_OPT("-pointer", true),
-               IGNORE_OPT("-quiet", false),
-               IGNORE_OPT("-rgamma", true),
-               IGNORE_OPT("-sharevts", false),
-               IGNORE_OPT("-screen", true),
-               IGNORE_OPT("-showDefaultModulePath", false),
-               IGNORE_OPT("-showDefaultLibPath", false),
-               IGNORE_OPT("-showopts", false),
-               IGNORE_OPT("-weight", true),
-               IGNORE_OPT("-verbose", true),
+               IGNORE_OPT("-allowMouseOpenFail", OPT_NOFLAG),
+               IGNORE_OPT("-allowNonLocalXvidtune", OPT_NOFLAG),
+               IGNORE_OPT("-bgamma", OPT_OPERAND),
+               IGNORE_OPT("-bpp", OPT_OPERAND), /* no longer supported by 
upstream Xorg(1) */
+               IGNORE_OPT("-config", OPT_OPERAND),
+               IGNORE_OPT("-configdir", OPT_OPERAND),
+               IGNORE_OPT("-configure", OPT_OPERAND),
+               IGNORE_OPT("-crt", OPT_OPERAND),
+               IGNORE_OPT("-depth", OPT_OPERAND),
+               IGNORE_OPT("-disableVidMode", OPT_NOFLAG),
+               IGNORE_OPT("-fbbbp", OPT_OPERAND),
+               IGNORE_OPT("-gamma", OPT_OPERAND),
+               IGNORE_OPT("-ggamma", OPT_OPERAND),
+               IGNORE_OPT("-ignoreABI", OPT_NOFLAG),
+               IGNORE_OPT("-isolateDevice", OPT_OPERAND),
+               IGNORE_OPT("-keeptty", OPT_NOFLAG),
+               IGNORE_OPT("-keyboard", OPT_OPERAND),
+               IGNORE_OPT("-layout", OPT_OPERAND),
+               IGNORE_OPT("-logverbose", OPT_OPERAND),
+               IGNORE_OPT("-modulepath", OPT_OPERAND),
+               IGNORE_OPT("-noautoBindCPU", OPT_NOFLAG),
+               IGNORE_OPT("-nosilk", OPT_NOFLAG),
+               IGNORE_OPT("-pointer", OPT_OPERAND),
+               IGNORE_OPT("-quiet", OPT_NOFLAG),
+               IGNORE_OPT("-rgamma", OPT_OPERAND),
+               IGNORE_OPT("-sharevts", OPT_NOFLAG),
+               IGNORE_OPT("-screen", OPT_OPERAND),
+               IGNORE_OPT("-showDefaultModulePath", OPT_NOFLAG),
+               IGNORE_OPT("-showDefaultLibPath", OPT_NOFLAG),
+               IGNORE_OPT("-showopts", OPT_NOFLAG),
+               IGNORE_OPT("-weight", OPT_OPERAND),
+               IGNORE_OPT("-verbose", OPT_OPERAND),
        };
        int socket_xwayback[2];
        int socket_xwayland[2];
 
-       signal(SIGCHLD, handle_child_exit);
        signal(SIGSEGV, handle_segv);
-       signal(SIGTERM, handle_exit);
 
        wayback_log_init("Xwayback", LOG_INFO, NULL);
 
        int cur_opt = 0;
        while (cur_opt = optparse(argc, argv, opts, ARRAY_SIZE(opts)), cur_opt 
!= -1) {
-               /* help message */
-               if (strcmp(argv[cur_opt], "-help") == 0) {
+               if (strcmp(argv[cur_opt], "-version") == 0 || 
strcmp(argv[cur_opt], "-showconfig") == 0) {
                        wayback_log(LOG_INFO,
-                                   "Wayback <https://wayback.freedesktop.org/> 
X.org compatibility layer");
-                       wayback_log(
-                               LOG_INFO,
-                               "Report bugs to 
<https://gitlab.freedesktop.org/wayback/wayback/-/issues>.");
-                       wayback_log(LOG_INFO, "Usage: %s [:<display>] 
[option]", argv[0]);
-                       for (size_t j = 0; j < ARRAY_SIZE(opts); j++) {
-                               if (!opts[j].ignore) {
-                                       wayback_log(LOG_INFO,
-                                                   "\t%s%s\t\t %s",
-                                                   opts[j].name,
-                                                   opts[j].req_operand ? " 
opt" : "",
-                                                   opts[j].description);
-                               }
-                       }
-                       exit(EXIT_SUCCESS);
-               } else if (strcmp(argv[cur_opt], "-version") == 0 ||
-                          strcmp(argv[cur_opt], "-showconfig") == 0) {
-                       wayback_log(LOG_INFO,
-                                   "Wayback <https://wayback.freedesktop.org/> 
X.org compatibility layer");
-                       wayback_log(LOG_INFO, "Alpha-quality release");
+                                   "Wayback <https://wayback.freedesktop.org/> 
X.Org compatibility layer");
+                       wayback_log(LOG_INFO, "Version %s", WAYBACK_VERSION);
                        exit(EXIT_SUCCESS);
                }
        }
@@ -463,7 +427,7 @@
                size_t j = 0;
                for (; j < ARRAY_SIZE(opts); j++) {
                        if (strcmp(opts[j].name, argv[i]) == 0) {
-                               if (opts[j].req_operand && (i + 1) < argc) {
+                               if (opts[j].flag == OPT_OPERAND && (i + 1) < 
argc) {
                                        i++;
                                }
                                break;
@@ -476,14 +440,18 @@
 
        arguments[count++] = NULL;
 
-       if (posix_spawn(&xway_pid, xwayland_path, NULL, NULL, (char 
**)arguments, environ) != 0) {
+       posix_spawn_file_actions_init(&file_actions);
+       posix_spawn_file_actions_addclose(&file_actions, socket_xwayback[1]);
+
+       if (posix_spawn(&xway_pid, xwayland_path, &file_actions, NULL, (char 
**)arguments, environ) !=
+           0) {
                wayback_log(LOG_ERROR, "Failed to launch Xwayland");
-               kill(comp_pid, SIGTERM);
                exit(EXIT_FAILURE);
        }
 
-       while (1)
-               pause();
+       close(socket_xwayland[1]);
+
+       waitid(P_PID, comp_pid, NULL, WEXITED);
 
        return 0;
 }

Reply via email to