app: fix #12542 crash due to invalid monitor
We store an `initial_monitor` in several places, not taking into consideration that a monitor object can become invalid, e.g. when disconnecting or turning off a monitor. When the monitor is invalid, it can cause a crash in `gimp_display_shell_set_initial_scale`. Instead of referencing the initial monitor, we request the monitor for our display shell. Since at that point we already know that shell is valid, we should get a valid monitor too.
This commit is contained in:
parent
2fc1fdd400
commit
fedb647cb4
1 changed files with 1 additions and 1 deletions
|
|
@ -933,7 +933,7 @@ gimp_display_shell_set_initial_scale (GimpDisplayShell *shell,
|
|||
|
||||
image = gimp_display_get_image (shell->display);
|
||||
|
||||
gdk_monitor_get_workarea (shell->initial_monitor, &workarea);
|
||||
gdk_monitor_get_workarea (gimp_widget_get_monitor (GTK_WIDGET (shell)), &workarea);
|
||||
|
||||
image_width = gimp_image_get_width (image);
|
||||
image_height = gimp_image_get_height (image);
|
||||
|
|
|
|||
Loading…
Reference in a new issue