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 2021-09-19 13:37:45 UTC |
6 |
+++ src/wayland/meta-wayland-private.h |
7 |
@@ -47,7 +47,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 |
@@ -57,7 +56,6 @@ typedef struct |
16 |
MetaXWaylandConnection private_connection; |
17 |
MetaXWaylandConnection public_connection; |
18 |
|
19 |
- guint abstract_fd_watch_id; |
20 |
guint unix_fd_watch_id; |
21 |
|
22 |
guint xserver_grace_period_id; |
23 |
--- src/wayland/meta-xwayland.c.orig 2021-09-19 13:37:45 UTC |
24 |
+++ src/wayland/meta-xwayland.c |
25 |
@@ -447,47 +447,6 @@ create_lock_file (int display, |
26 |
} |
27 |
|
28 |
static int |
29 |
-bind_to_abstract_socket (int display, |
30 |
- GError **error) |
31 |
-{ |
32 |
- struct sockaddr_un addr; |
33 |
- socklen_t size, name_size; |
34 |
- int fd; |
35 |
- |
36 |
- fd = socket (PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); |
37 |
- if (fd < 0) |
38 |
- { |
39 |
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), |
40 |
- "Failed to create socket: %s", g_strerror (errno)); |
41 |
- return -1; |
42 |
- } |
43 |
- |
44 |
- addr.sun_family = AF_LOCAL; |
45 |
- name_size = snprintf (addr.sun_path, sizeof addr.sun_path, |
46 |
- "%c%s%d", 0, X11_TMP_UNIX_PATH, display); |
47 |
- size = offsetof (struct sockaddr_un, sun_path) + name_size; |
48 |
- if (bind (fd, (struct sockaddr *) &addr, size) < 0) |
49 |
- { |
50 |
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), |
51 |
- "Failed to bind to %s: %s", |
52 |
- addr.sun_path + 1, g_strerror (errno)); |
53 |
- close (fd); |
54 |
- return -1; |
55 |
- } |
56 |
- |
57 |
- if (listen (fd, 1) < 0) |
58 |
- { |
59 |
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), |
60 |
- "Failed to listen to %s: %s", |
61 |
- addr.sun_path + 1, g_strerror (errno)); |
62 |
- close (fd); |
63 |
- return -1; |
64 |
- } |
65 |
- |
66 |
- return fd; |
67 |
-} |
68 |
- |
69 |
-static int |
70 |
bind_to_unix_socket (int display, |
71 |
GError **error) |
72 |
{ |
73 |
@@ -719,24 +678,17 @@ ensure_x11_unix_dir (GError **error) |
74 |
static gboolean |
75 |
open_display_sockets (MetaXWaylandManager *manager, |
76 |
int display_index, |
77 |
- int *abstract_fd_out, |
78 |
int *unix_fd_out, |
79 |
GError **error) |
80 |
{ |
81 |
- int abstract_fd, unix_fd; |
82 |
+ int unix_fd; |
83 |
|
84 |
- abstract_fd = bind_to_abstract_socket (display_index, error); |
85 |
- if (abstract_fd < 0) |
86 |
- return FALSE; |
87 |
- |
88 |
unix_fd = bind_to_unix_socket (display_index, error); |
89 |
if (unix_fd < 0) |
90 |
{ |
91 |
- close (abstract_fd); |
92 |
return FALSE; |
93 |
} |
94 |
|
95 |
- *abstract_fd_out = abstract_fd; |
96 |
*unix_fd_out = unix_fd; |
97 |
|
98 |
return TRUE; |
99 |
@@ -767,7 +719,6 @@ choose_xdisplay (MetaXWaylandManager *manager, |
100 |
} |
101 |
|
102 |
if (!open_display_sockets (manager, *display, |
103 |
- &connection->abstract_fd, |
104 |
&connection->unix_fd, |
105 |
&local_error)) |
106 |
{ |
107 |
@@ -992,13 +943,11 @@ meta_xwayland_start_xserver (MetaXWaylandManager *mana |
108 |
g_subprocess_launcher_take_fd (launcher, |
109 |
steal_fd (&xwayland_client_fd[1]), 3); |
110 |
g_subprocess_launcher_take_fd (launcher, |
111 |
- steal_fd (&manager->public_connection.abstract_fd), 4); |
112 |
+ steal_fd (&manager->public_connection.unix_fd), 4); |
113 |
g_subprocess_launcher_take_fd (launcher, |
114 |
- steal_fd (&manager->public_connection.unix_fd), 5); |
115 |
+ steal_fd (&displayfd[1]), 5); |
116 |
g_subprocess_launcher_take_fd (launcher, |
117 |
- steal_fd (&displayfd[1]), 6); |
118 |
- g_subprocess_launcher_take_fd (launcher, |
119 |
- steal_fd (&manager->private_connection.abstract_fd), 7); |
120 |
+ steal_fd (&manager->private_connection.unix_fd), 6); |
121 |
|
122 |
g_subprocess_launcher_setenv (launcher, "WAYLAND_SOCKET", "3", TRUE); |
123 |
|
124 |
@@ -1013,16 +962,14 @@ meta_xwayland_start_xserver (MetaXWaylandManager *mana |
125 |
args[i++] = manager->auth_file; |
126 |
args[i++] = XWAYLAND_LISTENFD; |
127 |
args[i++] = "4"; |
128 |
- args[i++] = XWAYLAND_LISTENFD; |
129 |
- args[i++] = "5"; |
130 |
args[i++] = "-displayfd"; |
131 |
- args[i++] = "6"; |
132 |
+ args[i++] = "5"; |
133 |
#ifdef HAVE_XWAYLAND_INITFD |
134 |
args[i++] = "-initfd"; |
135 |
- args[i++] = "7"; |
136 |
+ args[i++] = "6"; |
137 |
#else |
138 |
args[i++] = XWAYLAND_LISTENFD; |
139 |
- args[i++] = "7"; |
140 |
+ args[i++] = "6"; |
141 |
#endif |
142 |
for (j = 0; j < G_N_ELEMENTS (x11_extension_names); j++) |
143 |
{ |
144 |
@@ -1084,7 +1031,6 @@ xdisplay_connection_activity_cb (gint fd, |
145 |
(GAsyncReadyCallback) on_init_x11_cb, NULL); |
146 |
|
147 |
/* Stop watching both file descriptors */ |
148 |
- g_clear_handle_id (&manager->abstract_fd_watch_id, g_source_remove); |
149 |
g_clear_handle_id (&manager->unix_fd_watch_id, g_source_remove); |
150 |
|
151 |
return G_SOURCE_REMOVE; |
152 |
@@ -1176,14 +1122,12 @@ meta_xwayland_init (MetaXWaylandManager *manager, |
153 |
{ |
154 |
if (!open_display_sockets (manager, |
155 |
manager->public_connection.display_index, |
156 |
- &manager->public_connection.abstract_fd, |
157 |
&manager->public_connection.unix_fd, |
158 |
error)) |
159 |
return FALSE; |
160 |
|
161 |
if (!open_display_sockets (manager, |
162 |
manager->private_connection.display_index, |
163 |
- &manager->private_connection.abstract_fd, |
164 |
&manager->private_connection.unix_fd, |
165 |
error)) |
166 |
return FALSE; |
167 |
@@ -1198,9 +1142,6 @@ meta_xwayland_init (MetaXWaylandManager *manager, |
168 |
|
169 |
if (policy == META_X11_DISPLAY_POLICY_ON_DEMAND) |
170 |
{ |
171 |
- manager->abstract_fd_watch_id = |
172 |
- g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN, |
173 |
- xdisplay_connection_activity_cb, manager); |
174 |
manager->unix_fd_watch_id = |
175 |
g_unix_fd_add (manager->public_connection.unix_fd, G_IO_IN, |
176 |
xdisplay_connection_activity_cb, manager); |