[gimp] Keep around an "active_display" member in GimpImageWindow



commit a82169ee13ae60105fa673406e4f986ec2b42538
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 23 18:22:50 2009 +0200

    Keep around an "active_display" member in GimpImageWindow
    
    And add gimp_image_window_set_active_display(). Call the new function
    when creating a shell. Will all be done by the means of a GimpContext
    later, but is a step to get rid of FIXME hacks.

 app/display/gimpdisplayshell.c |    4 ++++
 app/display/gimpimagewindow.c  |   19 ++++++++++++++++++-
 app/display/gimpimagewindow.h  |    4 ++++
 3 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 9adb19e..9cb7863 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -807,6 +807,10 @@ gimp_display_shell_new (GimpDisplay       *display,
   shell->popup_manager   = popup_manager;
   shell->display_factory = display_factory;
 
+  /* FIXME image window */
+  gimp_image_window_set_active_display (GIMP_IMAGE_WINDOW (shell),
+                                        display);
+
   if (display->image)
     {
       options = shell->options;
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 5c886be..21216c1 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -348,12 +348,29 @@ gimp_image_window_style_set (GtkWidget *widget,
 
 /*  public functions  */
 
+void
+gimp_image_window_set_active_display (GimpImageWindow *window,
+                                      GimpDisplay     *display)
+{
+  g_return_if_fail (GIMP_IS_IMAGE_WINDOW (window));
+  g_return_if_fail (GIMP_IS_DISPLAY (display));
+
+  if (display == window->active_display)
+    return;
+
+  if (window->active_display)
+    {
+    }
+
+  window->active_display = display;
+}
+
 GimpDisplay *
 gimp_image_window_get_active_display (GimpImageWindow *window)
 {
   g_return_val_if_fail (GIMP_IS_IMAGE_WINDOW (window), NULL);
 
-  return GIMP_DISPLAY_SHELL (window)->display;
+  return window->active_display;
 }
 
 void
diff --git a/app/display/gimpimagewindow.h b/app/display/gimpimagewindow.h
index d83acab..f5dfb41 100644
--- a/app/display/gimpimagewindow.h
+++ b/app/display/gimpimagewindow.h
@@ -36,6 +36,8 @@ struct _GimpImageWindow
 {
   GimpWindow       parent_instance;
 
+  GimpDisplay     *active_display;
+
   GimpUIManager   *menubar_manager;
 
   GtkWidget       *main_vbox;
@@ -53,6 +55,8 @@ struct _GimpImageWindowClass
 
 GType         gimp_image_window_get_type           (void) G_GNUC_CONST;
 
+void          gimp_image_window_set_active_display (GimpImageWindow *window,
+                                                    GimpDisplay     *display);
 GimpDisplay * gimp_image_window_get_active_display (GimpImageWindow *window);
 
 void          gimp_image_window_set_fullscreen     (GimpImageWindow *window,



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