app: make new images jump around much less

Implement a mechanism to suspend/resume GimpImageWindow's "keep canvas
pos" logic which is used to keep the image in place across widget
changed such as show/hide rulers.

gimp_display_shell_fill(): call suspend()/resume() around
gimp_display_shell_appearance_update(), and center the image after
calculating the initial scale factor, so the image jumping at least
starts at the approximately right position.
This commit is contained in:
Michael Natterer
2016-01-11 01:50:29 +01:00
parent 26ea7a3530
commit cbf2311134
3 changed files with 57 additions and 8 deletions

View File

@ -1519,9 +1519,17 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
gimp_display_shell_set_unit (shell, unit);
gimp_display_shell_set_initial_scale (shell, scale, NULL, NULL);
/* center the image so subsequent stuff only moves it a little in
* the center
*/
gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
gimp_display_shell_sync_config (shell, shell->display->config);
gimp_image_window_suspend_keep_pos (window);
gimp_display_shell_appearance_update (shell);
gimp_image_window_resume_keep_pos (window);
gimp_image_window_update_tabs (window);
#if 0
gimp_help_set_help_data (shell->canvas, NULL, NULL);