mirror of https://github.com/GNOME/gimp.git
Bug 794356 - Rulers always shown for subsequent image views
Remove the connect_after() hack from GimpImageWindow again and instead add gimp_display_shell_canvas_realize_after() and restore the configured ruler visibility there. Should work for all cases now.
This commit is contained in:
parent
65a697ff67
commit
7230d5d777
|
@ -129,6 +129,20 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
|
|||
gtk_widget_show (shell->vrule);
|
||||
}
|
||||
|
||||
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,
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
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);
|
||||
|
|
|
@ -604,6 +604,9 @@ 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);
|
||||
|
|
|
@ -479,17 +479,9 @@ gimp_image_window_constructed (GObject *object)
|
|||
gtk_paned_pack1 (GTK_PANED (private->right_hpane), private->notebook,
|
||||
TRUE, TRUE);
|
||||
|
||||
/* 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, "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);
|
||||
|
|
Loading…
Reference in New Issue