diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index ea9c27d74..ef92b7dfc 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -741,6 +741,23 @@ prepare_auth_file (MetaXWaylandManager *manager, return TRUE; } +static void +add_local_user_to_xhost (Display *xdisplay) +{ + XHostAddress host_entry; + XServerInterpretedAddress siaddr; + + siaddr.type = (char *) "localuser"; + siaddr.typelength = strlen (siaddr.type); + siaddr.value = (char *) g_get_user_name(); + siaddr.valuelength = strlen (siaddr.value); + + host_entry.family = FamilyServerInterpreted; + host_entry.address = (char *) &siaddr; + + XAddHost (xdisplay, &host_entry); +} + static void on_init_x11_cb (MetaDisplay *display, GAsyncResult *result, @@ -1207,6 +1224,8 @@ meta_xwayland_setup_xdisplay (MetaXWaylandManager *manager, XSetIOErrorExitHandler (xdisplay, x_io_error_exit, manager); XFixesSetClientDisconnectMode (xdisplay, XFixesClientDisconnectFlagTerminate); + + add_local_user_to_xhost (xdisplay); } static void