From 4805d901c3064c4bd8570826c3e95cb8d1af2196 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 4 Dec 2023 16:31:14 +0100 Subject: [PATCH] xwayland: Add the output name for fullscreen rootful MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a new command line option "-output" to specify on which output Xwayland should be starting fullscreen when rootful. That allows to run multiple instances of Xwayland rootful fullscreen on multiple outputs. Signed-off-by: Olivier Fourdan Acked-by: Michel Dänzer --- hw/xwayland/man/Xwayland.man | 12 +++++++++++- hw/xwayland/xwayland-screen.c | 4 ++++ hw/xwayland/xwayland.c | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/man/Xwayland.man b/hw/xwayland/man/Xwayland.man index 26b554be8..62ace369a 100644 --- a/hw/xwayland/man/Xwayland.man +++ b/hw/xwayland/man/Xwayland.man @@ -124,6 +124,16 @@ support touch input. Force additional non-native modes to be exposed when viewporter is not supported by the Wayland compositor. .TP 8 +.B \-output \fIname\fP +Specifies on which output \fIXwayland\fP fullscreen rootful should be placed. +The name must match the name of an existing Wayland output (output names can +be found using wayland-info). + +If no matching output can be found, the Wayland compositor will decide on which +output the fullscreen rootful \fIXwayland\fP window will be placed. + +This option has no effect if \fIXwayland\fP is not running fullscreen rootful. +.TP 8 .B \-rootless Run \fIXwayland\fP rootless, so that X clients integrate seamlessly with Wayland clients in a Wayland desktop. That requires the Wayland server @@ -159,4 +169,4 @@ the name of the display of the Wayland server. .B XWAYLAND_NO_GLAMOR disable glamor and DRI3 support in \fIXwayland\fP, for testing purposes. .SH "SEE ALSO" -General information: \fIX\fP(@miscmansuffix@) +General information: \fIX\fP(@miscmansuffix@), \fIwayland-info\fP(@miscmansuffix@) diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 099207855..22afd4e94 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -253,6 +253,7 @@ xwl_close_screen(ScreenPtr screen) wl_display_disconnect(xwl_screen->display); screen->CloseScreen = xwl_screen->CloseScreen; + free(xwl_screen); return screen->CloseScreen(screen); @@ -846,6 +847,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) use_fixed_size = 1; xwl_screen->fullscreen = 1; } + else if (strcmp(argv[i], "-output") == 0) { + xwl_screen->output_name = argv[i + 1]; + } else if (strcmp(argv[i], "-host-grab") == 0) { xwl_screen->host_grab = 1; xwl_screen->has_grab = 1; diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 6ec573674..2aa9893a1 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -94,6 +94,7 @@ ddxUseMsg(void) ErrorF("-fullscreen run fullscreen when rootful\n"); ErrorF("-geometry WxH set Xwayland window size when rootful\n"); ErrorF("-host-grab disable host keyboard shortcuts when rootful\n"); + ErrorF("-output specify which output to use for fullscreen when rootful\n"); ErrorF("-wm fd create X client for wm on given fd\n"); ErrorF("-initfd fd add given fd as a listen socket for initialization clients\n"); ErrorF("-listenfd fd add given fd as a listen socket\n"); @@ -262,6 +263,10 @@ ddxProcessArgument(int argc, char *argv[], int i) else if (strcmp(argv[i], "-enable-ei-portal") == 0) { return 1; } + else if (strcmp(argv[i], "-output") == 0) { + CHECK_FOR_REQUIRED_ARGUMENTS(1); + return 2; + } return 0; }