mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	xdg-shell,layer-shell: assert that configure events are only sent to initialized surfaces
This helps to ensure that compositors behave correctly and don't confuse clients.
This commit is contained in:
		
							parent
							
								
									b13fe9b3a1
								
							
						
					
					
						commit
						66dfb7f49b
					
				
					 2 changed files with 2 additions and 8 deletions
				
			
		| 
						 | 
					@ -315,10 +315,7 @@ static const struct zwlr_layer_surface_v1_interface layer_surface_implementation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
uint32_t wlr_layer_surface_v1_configure(struct wlr_layer_surface_v1 *surface,
 | 
					uint32_t wlr_layer_surface_v1_configure(struct wlr_layer_surface_v1 *surface,
 | 
				
			||||||
		uint32_t width, uint32_t height) {
 | 
							uint32_t width, uint32_t height) {
 | 
				
			||||||
	if (!surface->initialized) {
 | 
						assert(surface->initialized);
 | 
				
			||||||
		wlr_log(WLR_ERROR, "A configure is sent to an uninitialized wlr_layer_surface_v1 %p",
 | 
					 | 
				
			||||||
			surface);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct wl_display *display =
 | 
						struct wl_display *display =
 | 
				
			||||||
		wl_client_get_display(wl_resource_get_client(surface->resource));
 | 
							wl_client_get_display(wl_resource_get_client(surface->resource));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -165,10 +165,7 @@ uint32_t wlr_xdg_surface_schedule_configure(struct wlr_xdg_surface *surface) {
 | 
				
			||||||
	struct wl_display *display = wl_client_get_display(surface->client->client);
 | 
						struct wl_display *display = wl_client_get_display(surface->client->client);
 | 
				
			||||||
	struct wl_event_loop *loop = wl_display_get_event_loop(display);
 | 
						struct wl_event_loop *loop = wl_display_get_event_loop(display);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!surface->initialized) {
 | 
						assert(surface->initialized);
 | 
				
			||||||
		wlr_log(WLR_ERROR, "A configure is scheduled for an uninitialized xdg_surface %p",
 | 
					 | 
				
			||||||
			surface);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (surface->configure_idle == NULL) {
 | 
						if (surface->configure_idle == NULL) {
 | 
				
			||||||
		surface->scheduled_serial = wl_display_next_serial(display);
 | 
							surface->scheduled_serial = wl_display_next_serial(display);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue