mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend: stop calling wl_display_terminate()
Leave it up to the compositor to decide what to do when a backend becomes unavailable.
This commit is contained in:
		
							parent
							
								
									4ad6e6c298
								
							
						
					
					
						commit
						3cc4374542
					
				
					 4 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
					@ -1790,7 +1790,7 @@ int handle_drm_event(int fd, uint32_t mask, void *data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (drmHandleEvent(fd, &event) != 0) {
 | 
						if (drmHandleEvent(fd, &event) != 0) {
 | 
				
			||||||
		wlr_log(WLR_ERROR, "drmHandleEvent failed");
 | 
							wlr_log(WLR_ERROR, "drmHandleEvent failed");
 | 
				
			||||||
		wl_display_terminate(drm->display);
 | 
							wlr_backend_destroy(&drm->backend);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return 1;
 | 
						return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -51,7 +51,7 @@ static int handle_libinput_readable(int fd, uint32_t mask, void *_backend) {
 | 
				
			||||||
	int ret = libinput_dispatch(backend->libinput_context);
 | 
						int ret = libinput_dispatch(backend->libinput_context);
 | 
				
			||||||
	if (ret != 0) {
 | 
						if (ret != 0) {
 | 
				
			||||||
		wlr_log(WLR_ERROR, "Failed to dispatch libinput: %s", strerror(-ret));
 | 
							wlr_log(WLR_ERROR, "Failed to dispatch libinput: %s", strerror(-ret));
 | 
				
			||||||
		wl_display_terminate(backend->display);
 | 
							wlr_backend_destroy(&backend->backend);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	struct libinput_event *event;
 | 
						struct libinput_event *event;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -59,7 +59,7 @@ static int dispatch_events(int fd, uint32_t mask, void *data) {
 | 
				
			||||||
		if (mask & WL_EVENT_ERROR) {
 | 
							if (mask & WL_EVENT_ERROR) {
 | 
				
			||||||
			wlr_log(WLR_ERROR, "Failed to read from remote Wayland display");
 | 
								wlr_log(WLR_ERROR, "Failed to read from remote Wayland display");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		wl_display_terminate(wl->local_display);
 | 
							wlr_backend_destroy(&wl->backend);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@ static int dispatch_events(int fd, uint32_t mask, void *data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (count < 0) {
 | 
						if (count < 0) {
 | 
				
			||||||
		wlr_log(WLR_ERROR, "Failed to dispatch remote Wayland display");
 | 
							wlr_log(WLR_ERROR, "Failed to dispatch remote Wayland display");
 | 
				
			||||||
		wl_display_terminate(wl->local_display);
 | 
							wlr_backend_destroy(&wl->backend);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return count;
 | 
						return count;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,7 +132,7 @@ static int x11_event(int fd, uint32_t mask, void *data) {
 | 
				
			||||||
		if (mask & WL_EVENT_ERROR) {
 | 
							if (mask & WL_EVENT_ERROR) {
 | 
				
			||||||
			wlr_log(WLR_ERROR, "Failed to read from X11 server");
 | 
								wlr_log(WLR_ERROR, "Failed to read from X11 server");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		wl_display_terminate(x11->wl_display);
 | 
							wlr_backend_destroy(&x11->backend);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -145,7 +145,7 @@ static int x11_event(int fd, uint32_t mask, void *data) {
 | 
				
			||||||
	int ret = xcb_connection_has_error(x11->xcb);
 | 
						int ret = xcb_connection_has_error(x11->xcb);
 | 
				
			||||||
	if (ret != 0) {
 | 
						if (ret != 0) {
 | 
				
			||||||
		wlr_log(WLR_ERROR, "X11 connection error (%d)", ret);
 | 
							wlr_log(WLR_ERROR, "X11 connection error (%d)", ret);
 | 
				
			||||||
		wl_display_terminate(x11->wl_display);
 | 
							wlr_backend_destroy(&x11->backend);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue