Skip to content

Commit

Permalink
wlserver: use gamescope-N wayland display name.
Browse files Browse the repository at this point in the history
Letting wayland use the default makes random things connect to us, which we
don't want.

Fixes #96.

Related to the va-api problem, but most likely not the only fix:

#23
  • Loading branch information
Plagman committed Sep 1, 2020
1 parent d36a11d commit 2a98d2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,18 @@ int wlserver_init(int argc, char **argv, bool bIsNested) {
wlserver.wlr.xwayland_server = wlr_xwayland_server_create(wlserver.wl_display, &xwayland_options);
wl_signal_add(&wlserver.wlr.xwayland_server->events.ready, &xwayland_ready_listener);

const char *socket = wl_display_add_socket_auto(wlserver.wl_display);
if (!socket)
char wayland_display_name[32];
int result = -1;
int display_slot = 0;

while ( result != 0 && display_slot < 128 )
{
sprintf( wayland_display_name, "gamescope-%d", display_slot );
result = wl_display_add_socket( wlserver.wl_display, wayland_display_name );
display_slot++;
}

if ( result != 0 )
{
wlr_log_errno(WLR_ERROR, "Unable to open wayland socket");
wlr_backend_destroy( wlserver.wlr.multi_backend );
Expand All @@ -474,7 +484,7 @@ int wlserver_init(int argc, char **argv, bool bIsNested) {
wlserver.wlr.seat = wlr_seat_create(wlserver.wl_display, "seat0");
wlr_seat_set_capabilities( wlserver.wlr.seat, WL_SEAT_CAPABILITY_POINTER | WL_SEAT_CAPABILITY_KEYBOARD );

wlr_log(WLR_INFO, "Running compositor on wayland display '%s'", socket);
wlr_log(WLR_INFO, "Running compositor on wayland display '%s'", wayland_display_name);

if (!wlr_backend_start( wlserver.wlr.multi_backend ))
{
Expand Down
2 changes: 1 addition & 1 deletion subprojects/wlroots
Submodule wlroots updated 80 files
+11 −2 CONTRIBUTING.md
+65 −23 backend/drm/atomic.c
+2 −3 backend/drm/backend.c
+136 −150 backend/drm/drm.c
+25 −6 backend/drm/legacy.c
+4 −6 backend/drm/renderer.c
+5 −6 backend/headless/output.c
+5 −0 backend/noop/output.c
+2 −8 backend/wayland/output.c
+1 −6 backend/wayland/seat.c
+13 −10 backend/wayland/tablet_v2.c
+2 −4 backend/x11/output.c
+0 −2 examples/fullscreen-shell.c
+1 −1 examples/idle.c
+217 −0 examples/input-method-keyboard-grab.c
+15 −0 examples/meson.build
+13 −2 examples/output-power-management.c
+1 −1 examples/pointer.c
+362 −0 examples/screencopy-dmabuf.c
+8 −8 include/backend/drm/drm.h
+7 −0 include/render/gles2.h
+8 −0 include/types/wlr_keyboard.h
+22 −0 include/util/time.h
+98 −1 include/wlr/interfaces/wlr_output.h
+21 −1 include/wlr/render/egl.h
+6 −3 include/wlr/render/interface.h
+13 −0 include/wlr/render/wlr_renderer.h
+5 −0 include/wlr/types/wlr_box.h
+4 −0 include/wlr/types/wlr_buffer.h
+31 −1 include/wlr/types/wlr_input_method_v2.h
+24 −0 include/wlr/types/wlr_keyboard_group.h
+0 −2 include/wlr/types/wlr_layer_shell_v1.h
+6 −0 include/wlr/types/wlr_output.h
+4 −1 include/wlr/types/wlr_screencopy_v1.h
+129 −101 include/wlr/types/wlr_seat.h
+28 −1 include/wlr/types/wlr_surface.h
+34 −0 include/wlr/types/wlr_viewporter.h
+4 −1 include/wlr/types/wlr_virtual_keyboard_v1.h
+3 −0 include/wlr/util/region.h
+2 −0 include/xwayland/selection.h
+2 −2 meson.build
+1 −0 protocol/meson.build
+13 −3 protocol/wlr-layer-shell-unstable-v1.xml
+39 −14 protocol/wlr-screencopy-unstable-v1.xml
+153 −38 render/egl.c
+164 −38 render/gles2/renderer.c
+1 −1 render/gles2/shaders.c
+8 −6 render/gles2/texture.c
+27 −2 render/wlr_renderer.c
+16 −2 types/data_device/wlr_drag.c
+1 −0 types/meson.build
+15 −9 types/seat/wlr_seat.c
+21 −1 types/seat/wlr_seat_keyboard.c
+26 −6 types/seat/wlr_seat_pointer.c
+4 −0 types/seat/wlr_seat_touch.c
+7 −10 types/tablet_v2/wlr_tablet_v2_tool.c
+2 −1 types/wlr_export_dmabuf_v1.c
+203 −10 types/wlr_input_method_v2.c
+4 −3 types/wlr_keyboard.c
+48 −9 types/wlr_keyboard_group.c
+14 −13 types/wlr_layer_shell_v1.c
+11 −8 types/wlr_output.c
+111 −26 types/wlr_screencopy_v1.c
+107 −12 types/wlr_surface.c
+224 −0 types/wlr_viewporter.c
+8 −0 types/wlr_virtual_keyboard_v1.c
+10 −1 types/wlr_xdg_decoration_v1.c
+15 −5 types/xdg_shell/wlr_xdg_popup.c
+11 −7 types/xdg_shell/wlr_xdg_surface.c
+10 −0 types/xdg_shell_v6/wlr_xdg_popup_v6.c
+10 −6 types/xdg_shell_v6/wlr_xdg_surface_v6.c
+2 −12 util/log.c
+1 −0 util/meson.build
+10 −5 util/region.c
+27 −0 util/time.c
+1 −1 xcursor/xcursor.c
+21 −0 xwayland/selection/outgoing.c
+12 −6 xwayland/server.c
+0 −2 xwayland/xwayland.c
+11 −4 xwayland/xwm.c

0 comments on commit 2a98d2b

Please sign in to comment.