From db7a28b187aa4ef8fee1a325bc493a16694a850b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Wed, 17 Nov 2021 13:45:42 +0100 Subject: Add support for opening Xcursor files Sadly, they don't have a canonical extension, and they don't show up in the browser. We might want to employ some level of sniffing. The first 16 bytes are enough to identify a lot. --- fastiv-view.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fastiv-view.c') diff --git a/fastiv-view.c b/fastiv-view.c index 83ecabb..b7be9cd 100644 --- a/fastiv-view.c +++ b/fastiv-view.c @@ -86,7 +86,10 @@ get_surface_dimensions(FastivView *self, double *width, double *height) *height = cairo_image_surface_get_height(self->surface); return; case CAIRO_SURFACE_TYPE_RECORDING: - (void) cairo_recording_surface_get_extents(self->surface, &extents); + if (!cairo_recording_surface_get_extents(self->surface, &extents)) + cairo_recording_surface_ink_extents(self->surface, + &extents.x, &extents.y, &extents.width, &extents.height); + *width = extents.width; *height = extents.height; return; -- cgit v1.2.3