Tweak display finding logic of previous commit a bit

(gimp_display_new): add the new shell to the active display's image
window, not the first display's.
This commit is contained in:
Michael Natterer 2009-10-02 21:50:02 +02:00
parent 3106b66186
commit 3d13f8d4d5
1 changed files with 11 additions and 5 deletions

View File

@ -30,6 +30,7 @@
#include "core/gimp.h"
#include "core/gimparea.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpprogress.h"
@ -385,14 +386,19 @@ gimp_display_new (Gimp *gimp,
/* get an image window */
if (GIMP_GUI_CONFIG (display->config)->single_window_mode)
{
GimpDisplay *first_display;
GimpDisplay *active_display;
first_display =
GIMP_DISPLAY (gimp_container_get_first_child (gimp->displays));
active_display = gimp_context_get_display (gimp_get_user_context (gimp));
if (first_display)
if (! active_display)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (first_display->shell);
active_display =
GIMP_DISPLAY (gimp_container_get_first_child (gimp->displays));
}
if (active_display)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (active_display->shell);
window = gimp_display_shell_get_window (shell);
}