|
Added
Link Here
|
| 1 |
https://gitlab.gnome.org/GNOME/mutter/-/commit/e2123768f635 |
| 2 |
|
| 3 |
mutter-WARNING **: failed to bind to @/tmp/.X11-unix/X0: No such file or directory |
| 4 |
|
| 5 |
--- src/wayland/meta-wayland-private.h.orig 2020-09-07 19:18:23 UTC |
| 6 |
+++ src/wayland/meta-wayland-private.h |
| 7 |
@@ -46,7 +46,6 @@ typedef struct |
| 8 |
{ |
| 9 |
int display_index; |
| 10 |
char *lock_file; |
| 11 |
- int abstract_fd; |
| 12 |
int unix_fd; |
| 13 |
char *name; |
| 14 |
} MetaXWaylandConnection; |
| 15 |
--- src/wayland/meta-xwayland.c.orig 2020-09-07 19:18:23 UTC |
| 16 |
+++ src/wayland/meta-xwayland.c |
| 17 |
@@ -236,46 +236,6 @@ create_lock_file (int display, int *display_out) |
| 18 |
} |
| 19 |
|
| 20 |
static int |
| 21 |
-bind_to_abstract_socket (int display, |
| 22 |
- gboolean *fatal) |
| 23 |
-{ |
| 24 |
- struct sockaddr_un addr; |
| 25 |
- socklen_t size, name_size; |
| 26 |
- int fd; |
| 27 |
- |
| 28 |
- fd = socket (PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); |
| 29 |
- if (fd < 0) |
| 30 |
- { |
| 31 |
- *fatal = TRUE; |
| 32 |
- g_warning ("Failed to create socket: %m"); |
| 33 |
- return -1; |
| 34 |
- } |
| 35 |
- |
| 36 |
- addr.sun_family = AF_LOCAL; |
| 37 |
- name_size = snprintf (addr.sun_path, sizeof addr.sun_path, |
| 38 |
- "%c/tmp/.X11-unix/X%d", 0, display); |
| 39 |
- size = offsetof (struct sockaddr_un, sun_path) + name_size; |
| 40 |
- if (bind (fd, (struct sockaddr *) &addr, size) < 0) |
| 41 |
- { |
| 42 |
- *fatal = errno != EADDRINUSE; |
| 43 |
- g_warning ("failed to bind to @%s: %m", addr.sun_path + 1); |
| 44 |
- close (fd); |
| 45 |
- return -1; |
| 46 |
- } |
| 47 |
- |
| 48 |
- if (listen (fd, 1) < 0) |
| 49 |
- { |
| 50 |
- *fatal = errno != EADDRINUSE; |
| 51 |
- g_warning ("Failed to listen on abstract socket @%s: %m", |
| 52 |
- addr.sun_path + 1); |
| 53 |
- close (fd); |
| 54 |
- return -1; |
| 55 |
- } |
| 56 |
- |
| 57 |
- return fd; |
| 58 |
-} |
| 59 |
- |
| 60 |
-static int |
| 61 |
bind_to_unix_socket (int display) |
| 62 |
{ |
| 63 |
struct sockaddr_un addr; |
| 64 |
@@ -381,26 +341,18 @@ meta_xwayland_override_display_number (int number) |
| 65 |
static gboolean |
| 66 |
open_display_sockets (MetaXWaylandManager *manager, |
| 67 |
int display_index, |
| 68 |
- int *abstract_fd_out, |
| 69 |
int *unix_fd_out, |
| 70 |
gboolean *fatal) |
| 71 |
{ |
| 72 |
- int abstract_fd, unix_fd; |
| 73 |
+ int unix_fd; |
| 74 |
|
| 75 |
- abstract_fd = bind_to_abstract_socket (display_index, |
| 76 |
- fatal); |
| 77 |
- if (abstract_fd < 0) |
| 78 |
- return FALSE; |
| 79 |
- |
| 80 |
unix_fd = bind_to_unix_socket (display_index); |
| 81 |
if (unix_fd < 0) |
| 82 |
{ |
| 83 |
*fatal = FALSE; |
| 84 |
- close (abstract_fd); |
| 85 |
return FALSE; |
| 86 |
} |
| 87 |
|
| 88 |
- *abstract_fd_out = abstract_fd; |
| 89 |
*unix_fd_out = unix_fd; |
| 90 |
|
| 91 |
return TRUE; |
| 92 |
@@ -429,7 +381,6 @@ choose_xdisplay (MetaXWaylandManager *manager, |
| 93 |
} |
| 94 |
|
| 95 |
if (!open_display_sockets (manager, display, |
| 96 |
- &connection->abstract_fd, |
| 97 |
&connection->unix_fd, |
| 98 |
&fatal)) |
| 99 |
{ |
| 100 |
@@ -617,10 +568,9 @@ meta_xwayland_start_xserver (MetaXWaylandManager *mana |
| 101 |
launcher = g_subprocess_launcher_new (flags); |
| 102 |
|
| 103 |
g_subprocess_launcher_take_fd (launcher, xwayland_client_fd[1], 3); |
| 104 |
- g_subprocess_launcher_take_fd (launcher, manager->public_connection.abstract_fd, 4); |
| 105 |
- g_subprocess_launcher_take_fd (launcher, manager->public_connection.unix_fd, 5); |
| 106 |
- g_subprocess_launcher_take_fd (launcher, displayfd[1], 6); |
| 107 |
- g_subprocess_launcher_take_fd (launcher, manager->private_connection.abstract_fd, 7); |
| 108 |
+ g_subprocess_launcher_take_fd (launcher, manager->public_connection.unix_fd, 4); |
| 109 |
+ g_subprocess_launcher_take_fd (launcher, displayfd[1], 5); |
| 110 |
+ g_subprocess_launcher_take_fd (launcher, manager->private_connection.unix_fd, 6); |
| 111 |
|
| 112 |
g_subprocess_launcher_setenv (launcher, "WAYLAND_SOCKET", "3", TRUE); |
| 113 |
|
| 114 |
@@ -633,12 +583,11 @@ meta_xwayland_start_xserver (MetaXWaylandManager *mana |
| 115 |
"-core", |
| 116 |
"-auth", manager->auth_file, |
| 117 |
"-listen", "4", |
| 118 |
- "-listen", "5", |
| 119 |
- "-displayfd", "6", |
| 120 |
+ "-displayfd", "5", |
| 121 |
#ifdef HAVE_XWAYLAND_INITFD |
| 122 |
- "-initfd", "7", |
| 123 |
+ "-initfd", "6", |
| 124 |
#else |
| 125 |
- "-listen", "7", |
| 126 |
+ "-listen", "6", |
| 127 |
#endif |
| 128 |
NULL); |
| 129 |
|
| 130 |
@@ -756,14 +705,12 @@ meta_xwayland_init (MetaXWaylandManager *manager, |
| 131 |
{ |
| 132 |
if (!open_display_sockets (manager, |
| 133 |
manager->public_connection.display_index, |
| 134 |
- &manager->public_connection.abstract_fd, |
| 135 |
&manager->public_connection.unix_fd, |
| 136 |
&fatal)) |
| 137 |
return FALSE; |
| 138 |
|
| 139 |
if (!open_display_sockets (manager, |
| 140 |
manager->private_connection.display_index, |
| 141 |
- &manager->private_connection.abstract_fd, |
| 142 |
&manager->private_connection.unix_fd, |
| 143 |
&fatal)) |
| 144 |
return FALSE; |
| 145 |
@@ -774,7 +721,7 @@ meta_xwayland_init (MetaXWaylandManager *manager, |
| 146 |
|
| 147 |
if (policy == META_DISPLAY_POLICY_ON_DEMAND) |
| 148 |
{ |
| 149 |
- g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN, |
| 150 |
+ g_unix_fd_add (manager->public_connection.unix_fd, G_IO_IN, |
| 151 |
xdisplay_connection_activity_cb, manager); |
| 152 |
} |
| 153 |
|