[gimp] app: update the display profile transform when the color config changes



commit 8b824305a0f3827ff5f255b1d85b1578bf823d9d
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 27 12:30:32 2015 +0200

    app: update the display profile transform when the color config changes

 app/display/gimpdisplayshell-handlers.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c
index 6f11d3b..ea319b4 100644
--- a/app/display/gimpdisplayshell-handlers.c
+++ b/app/display/gimpdisplayshell-handlers.c
@@ -58,6 +58,7 @@
 #include "gimpdisplayshell-expose.h"
 #include "gimpdisplayshell-handlers.h"
 #include "gimpdisplayshell-icon.h"
+#include "gimpdisplayshell-profile.h"
 #include "gimpdisplayshell-scale.h"
 #include "gimpdisplayshell-scroll.h"
 #include "gimpdisplayshell-selection.h"
@@ -162,6 +163,9 @@ static void   gimp_display_shell_ants_speed_notify_handler  (GObject          *c
 static void   gimp_display_shell_quality_notify_handler     (GObject          *config,
                                                              GParamSpec       *param_spec,
                                                              GimpDisplayShell *shell);
+static void   gimp_display_shell_color_config_notify_handler(GObject          *config,
+                                                             GParamSpec       *param_spec,
+                                                             GimpDisplayShell *shell);
 
 
 /*  public functions  */
@@ -348,8 +352,15 @@ gimp_display_shell_connect (GimpDisplayShell *shell)
                     G_CALLBACK (gimp_display_shell_quality_notify_handler),
                     shell);
 
+  g_signal_connect (GIMP_CORE_CONFIG (shell->display->config)->color_management,
+                    "notify",
+                    G_CALLBACK (gimp_display_shell_color_config_notify_handler),
+                    shell);
+
   gimp_display_shell_invalidate_preview_handler (image, shell);
   gimp_display_shell_quick_mask_changed_handler (image, shell);
+  gimp_display_shell_profile_changed_handler    (GIMP_COLOR_MANAGED (image),
+                                                 shell);
 
   gimp_canvas_layer_boundary_set_layer (GIMP_CANVAS_LAYER_BOUNDARY (shell->layer_boundary),
                                         gimp_image_get_active_layer (image));
@@ -376,6 +387,10 @@ gimp_display_shell_disconnect (GimpDisplayShell *shell)
   gimp_canvas_layer_boundary_set_layer (GIMP_CANVAS_LAYER_BOUNDARY (shell->layer_boundary),
                                         NULL);
 
+  g_signal_handlers_disconnect_by_func (GIMP_CORE_CONFIG (shell->display->config)->color_management,
+                                        gimp_display_shell_color_config_notify_handler,
+                                        shell);
+
   g_signal_handlers_disconnect_by_func (shell->display->config,
                                         gimp_display_shell_quality_notify_handler,
                                         shell);
@@ -1041,3 +1056,12 @@ gimp_display_shell_quality_notify_handler (GObject          *config,
 {
   gimp_display_shell_expose_full (shell);
 }
+
+static void
+gimp_display_shell_color_config_notify_handler (GObject          *config,
+                                                GParamSpec       *param_spec,
+                                                GimpDisplayShell *shell)
+{
+  gimp_display_shell_profile_update (shell);
+  gimp_display_shell_expose_full (shell);
+}


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