mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	swaybg: check that background can be loaded
This commit is contained in:
		
							parent
							
								
									f745a3b3ef
								
							
						
					
					
						commit
						d06ec90a9d
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -97,6 +97,14 @@ int main(int argc, const char **argv) {
 | 
				
			||||||
		if (!image) {
 | 
							if (!image) {
 | 
				
			||||||
			sway_abort("Failed to read background image.");
 | 
								sway_abort("Failed to read background image.");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) {
 | 
				
			||||||
 | 
								sway_abort("Failed to read background image: %s."
 | 
				
			||||||
 | 
					#ifndef WITH_GDK_PIXBUF
 | 
				
			||||||
 | 
										"\nSway was compiled without gdk_pixbuf support, so only"
 | 
				
			||||||
 | 
										"\nPNG images can be loaded. This is the likely cause."
 | 
				
			||||||
 | 
					#endif //WITH_GDK_PIXBUF
 | 
				
			||||||
 | 
										, cairo_status_to_string(cairo_surface_status(image)));
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		double width = cairo_image_surface_get_width(image);
 | 
							double width = cairo_image_surface_get_width(image);
 | 
				
			||||||
		double height = cairo_image_surface_get_height(image);
 | 
							double height = cairo_image_surface_get_height(image);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue