[gimp/gtk3-port: 278/444] Revert "Bug 794356 - Rulers always shown for subsequent image views"



commit 80dbdc852855fd66d060f11821716818e9a821b9
Author: Jehan <jehan girinstud io>
Date:   Wed May 2 01:23:54 2018 +0200

    Revert "Bug 794356 - Rulers always shown for subsequent image views"
    
    This reverts commit 7230d5d777c98fb4896f1de76c147deb4f3ae692.
    Remove GTK+2 only hack.

 app/display/gimpdisplayshell-callbacks.c |   14 --------------
 app/display/gimpdisplayshell-callbacks.h |    2 --
 app/display/gimpdisplayshell.c           |    3 ---
 app/display/gimpimagewindow.c            |   14 +++++++++++---
 4 files changed, 11 insertions(+), 22 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index 8341e7b..55acd7b 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -130,20 +130,6 @@ gimp_display_shell_canvas_realize (GtkWidget        *canvas,
 }
 
 void
-gimp_display_shell_canvas_realize_after (GtkWidget        *canvas,
-                                         GimpDisplayShell *shell)
-{
-  GimpImageWindow *window = gimp_display_shell_get_window (shell);
-
-  /*  HACK: see above: must go with GTK+ 3.x too. Restore the rulers'
-   *  intended visibility again.
-   */
-  gimp_image_window_suspend_keep_pos (window);
-  gimp_display_shell_appearance_update (shell);
-  gimp_image_window_resume_keep_pos (window);
-}
-
-void
 gimp_display_shell_canvas_size_allocate (GtkWidget        *widget,
                                          GtkAllocation    *allocation,
                                          GimpDisplayShell *shell)
diff --git a/app/display/gimpdisplayshell-callbacks.h b/app/display/gimpdisplayshell-callbacks.h
index 5b6b5e9..551f2d5 100644
--- a/app/display/gimpdisplayshell-callbacks.h
+++ b/app/display/gimpdisplayshell-callbacks.h
@@ -21,8 +21,6 @@
 
 void       gimp_display_shell_canvas_realize          (GtkWidget        *widget,
                                                        GimpDisplayShell *shell);
-void       gimp_display_shell_canvas_realize_after    (GtkWidget        *widget,
-                                                       GimpDisplayShell *shell);
 void       gimp_display_shell_canvas_size_allocate    (GtkWidget        *widget,
                                                        GtkAllocation    *alloc,
                                                        GimpDisplayShell *shell);
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 1fd027b..2a7612f 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -591,9 +591,6 @@ gimp_display_shell_constructed (GObject *object)
   g_signal_connect (shell->canvas, "realize",
                     G_CALLBACK (gimp_display_shell_canvas_realize),
                     shell);
-  g_signal_connect (shell->canvas, "realize",
-                    G_CALLBACK (gimp_display_shell_canvas_realize_after),
-                    shell);
   g_signal_connect (shell->canvas, "size-allocate",
                     G_CALLBACK (gimp_display_shell_canvas_size_allocate),
                     shell);
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 5b27109..39eb4a9 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -467,9 +467,17 @@ gimp_image_window_constructed (GObject *object)
   gtk_paned_pack1 (GTK_PANED (private->right_hpane), private->notebook,
                    TRUE, TRUE);
 
-  g_signal_connect (private->notebook, "switch-page",
-                    G_CALLBACK (gimp_image_window_switch_page),
-                    window);
+  /*  HACK: remove with GTK+ 3.x: there is no reason to
+   *  connect_after() here except the HACK at the end of
+   *  gimp_display_shell_canvas_realize().
+   *
+   *  We need to make sure gimp_display_shell_appearance_update() is
+   *  called after realize() so the ill-shown rulers are properly
+   *  hidden again
+   */
+  g_signal_connect_after (private->notebook, "switch-page",
+                          G_CALLBACK (gimp_image_window_switch_page),
+                          window);
   g_signal_connect (private->notebook, "page-removed",
                     G_CALLBACK (gimp_image_window_page_removed),
                     window);


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