mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xwayland: (Re)set seat when xwayland is ready
For some reason wlroots will reset the seat assigned to xwayland to NULL whenever Xwayland terminates. This patch restores the seat whenever Xwayland is ready again. Fixes #166 Fixes #444 Thanks @droc12345 for figuring out the actual issue.
This commit is contained in:
		
							parent
							
								
									6e1dd2dbfa
								
							
						
					
					
						commit
						819404c43b
					
				
					 2 changed files with 15 additions and 4 deletions
				
			
		| 
						 | 
					@ -165,6 +165,7 @@ struct server {
 | 
				
			||||||
	struct wl_listener xdg_toplevel_decoration;
 | 
						struct wl_listener xdg_toplevel_decoration;
 | 
				
			||||||
#if HAVE_XWAYLAND
 | 
					#if HAVE_XWAYLAND
 | 
				
			||||||
	struct wlr_xwayland *xwayland;
 | 
						struct wlr_xwayland *xwayland;
 | 
				
			||||||
 | 
						struct wl_listener xwayland_ready;
 | 
				
			||||||
	struct wl_listener new_xwayland_surface;
 | 
						struct wl_listener new_xwayland_surface;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										18
									
								
								src/server.c
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								src/server.c
									
										
									
									
									
								
							| 
						 | 
					@ -174,6 +174,16 @@ handle_drm_lease_request(struct wl_listener *listener, void *data)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_XWAYLAND
 | 
				
			||||||
 | 
					static void
 | 
				
			||||||
 | 
					handle_xwayland_ready(struct wl_listener *listener, void *data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct server *server =
 | 
				
			||||||
 | 
							wl_container_of(listener, server, xwayland_ready);
 | 
				
			||||||
 | 
						wlr_xwayland_set_seat(server->xwayland, server->seat.seat);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
server_init(struct server *server)
 | 
					server_init(struct server *server)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -403,6 +413,10 @@ server_init(struct server *server)
 | 
				
			||||||
	wl_signal_add(&server->xwayland->events.new_surface,
 | 
						wl_signal_add(&server->xwayland->events.new_surface,
 | 
				
			||||||
		      &server->new_xwayland_surface);
 | 
							      &server->new_xwayland_surface);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						server->xwayland_ready.notify = handle_xwayland_ready;
 | 
				
			||||||
 | 
						wl_signal_add(&server->xwayland->events.ready,
 | 
				
			||||||
 | 
							&server->xwayland_ready);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (setenv("DISPLAY", server->xwayland->display_name, true) < 0) {
 | 
						if (setenv("DISPLAY", server->xwayland->display_name, true) < 0) {
 | 
				
			||||||
		wlr_log_errno(WLR_ERROR, "unable to set DISPLAY for xwayland");
 | 
							wlr_log_errno(WLR_ERROR, "unable to set DISPLAY for xwayland");
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					@ -457,10 +471,6 @@ server_start(struct server *server)
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		wlr_log(WLR_DEBUG, "WAYLAND_DISPLAY=%s", socket);
 | 
							wlr_log(WLR_DEBUG, "WAYLAND_DISPLAY=%s", socket);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if HAVE_XWAYLAND
 | 
					 | 
				
			||||||
	wlr_xwayland_set_seat(server->xwayland, server->seat.seat);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue