aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-17 13:45:42 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-17 13:49:15 +0100
commitdb7a28b187aa4ef8fee1a325bc493a16694a850b (patch)
tree96ebced6de94cdf3ad01b829a892d097f8c0691f /fastiv-view.c
parente8754f43a602f76fdbd35cdd24f9cfeeb4cdcf2b (diff)
downloadfiv-db7a28b187aa4ef8fee1a325bc493a16694a850b.tar.gz
fiv-db7a28b187aa4ef8fee1a325bc493a16694a850b.tar.xz
fiv-db7a28b187aa4ef8fee1a325bc493a16694a850b.zip
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.
Diffstat (limited to 'fastiv-view.c')
-rw-r--r--fastiv-view.c5
1 files changed, 4 insertions, 1 deletions
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;