xwayland: Add the output name for fullscreen rootful

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 <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
Olivier Fourdan 2023-12-04 16:31:14 +01:00 committed by Olivier Fourdan
parent 87ca6dcb43
commit 4805d901c3
3 changed files with 20 additions and 1 deletions

View File

@ -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@)

View File

@ -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;

View File

@ -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;
}