summaryrefslogtreecommitdiff
path: root/src/eom-image.c
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-12-27 17:13:43 +0800
committerraveit65 <[email protected]>2020-01-09 00:04:07 +0100
commitbe4fa2808c4e1a36c2c9b58c1267a54cdda6e495 (patch)
treecebf7d01ff8450fa58140f4d8137b073f2c19ff2 /src/eom-image.c
parentc8773d8a8ad908db7cc14e600c359f116e0d241a (diff)
downloadeom-be4fa2808c4e1a36c2c9b58c1267a54cdda6e495.tar.bz2
eom-be4fa2808c4e1a36c2c9b58c1267a54cdda6e495.tar.xz
enable wayland support
Diffstat (limited to 'src/eom-image.c')
-rw-r--r--src/eom-image.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/eom-image.c b/src/eom-image.c
index f8add9d..01a869a 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -24,6 +24,7 @@
#endif
#define GDK_PIXBUF_ENABLE_BACKEND
+#include <gdk/gdkx.h>
#include "eom-image.h"
#include "eom-image-private.h"
@@ -58,7 +59,7 @@
#include <libexif/exif-loader.h>
#endif
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
#include <lcms2.h>
#ifndef EXIF_TAG_GAMMA
#define EXIF_TAG_GAMMA 0xa500
@@ -142,9 +143,11 @@ eom_image_free_mem_private (EomImage *image)
}
#endif
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
if (priv->profile != NULL) {
- cmsCloseProfile (priv->profile);
+ if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+ cmsCloseProfile (priv->profile);
+ }
priv->profile = NULL;
}
#endif
@@ -306,7 +309,7 @@ eom_image_init (EomImage *img)
#ifdef HAVE_EXEMPI
img->priv->xmp = NULL;
#endif
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
img->priv->profile = NULL;
#endif
#ifdef HAVE_RSVG
@@ -616,7 +619,7 @@ eom_image_get_file_info (EomImage *img,
}
}
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
void
eom_image_apply_display_profile (EomImage *img, cmsHPROFILE screen)
{
@@ -630,6 +633,9 @@ eom_image_apply_display_profile (EomImage *img, cmsHPROFILE screen)
priv = img->priv;
if (screen == NULL) return;
+ if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+ return;
+ }
if (priv->profile == NULL) {
/* Check whether GdkPixbuf was able to extract a profile */
@@ -1062,7 +1068,7 @@ eom_image_real_load (EomImage *img,
if (set_metadata) {
eom_image_set_exif_data (img, md_reader);
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
eom_image_set_icc_data (img, md_reader);
#endif
@@ -1348,7 +1354,7 @@ eom_image_get_pixbuf (EomImage *img)
return image;
}
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
cmsHPROFILE
eom_image_get_profile (EomImage *img)
{