[eog] Disable color management support on !X



commit a0cd6794c963bdd0faf77bd037229fe91c80c586
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 13 23:20:53 2013 -0400

    Disable color management support on !X
    
    The color management support uses X root window properties, and
    direct Xlib calls. For now, simply disable this code if we are
    not using X11.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695818

 src/eog-window.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index aec3e48..0b00961 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -74,12 +74,10 @@
 #include <libpeas/peas-extension-set.h>
 #include <libpeas/peas-activatable.h>
 
-#if HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
-#ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
-#endif
 #include <lcms2.h>
 #endif
 
@@ -392,10 +390,11 @@ eog_window_can_save_changed_cb (GSettings   *settings,
        }
 }
 
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
 static cmsHPROFILE *
 eog_window_get_display_profile (GtkWidget *window)
 {
+       GdkScreen *screen;
        Display *dpy;
        Atom icc_atom, type;
        int format;
@@ -406,9 +405,12 @@ eog_window_get_display_profile (GtkWidget *window)
        int result;
        cmsHPROFILE *profile = NULL;
        char *atom_name;
-       GdkScreen *screen;
 
        screen = gtk_widget_get_screen (window);
+
+        if (!GDK_IS_X11_SCREEN (screen))
+                return NULL;
+
        dpy = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
 
        if (gdk_screen_get_number (screen) > 0)
@@ -4757,7 +4759,7 @@ eog_window_init (EogWindow *window)
        window->priv->mode = EOG_WINDOW_MODE_UNKNOWN;
        window->priv->status = EOG_WINDOW_STATUS_UNKNOWN;
 
-#ifdef HAVE_LCMS
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
        window->priv->display_profile =
                eog_window_get_display_profile (GTK_WIDGET (window));
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]