Commit d8badd1b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

merged fix for #79486 from stable branch.

2002-12-13  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap):
	merged fix for #79486 from stable branch.
parent 12890477
2002-12-13 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap):
merged fix for #79486 from stable branch.
2002-12-13 Sven Neumann <sven@gimp.org>
 
* libgimp/gimpintl.h
......
......@@ -2169,13 +2169,16 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
gdk_window_get_origin (GTK_WIDGET (shell)->window, &shell_x, &shell_y);
/* if the window is offscreen, center it... */
if (shell_x > s_width || shell_y > s_height ||
(shell_x + width + border_x) < 0 || (shell_y + height + border_y) < 0)
if (shell_x > s_width ||
shell_y > s_height ||
(shell_x + width + border_x) < 0 ||
(shell_y + height + border_y) < 0)
{
shell_x = (s_width - width - border_x) >> 1;
shell_y = (s_height - height - border_y) >> 1;
shell_x = (s_width - width - border_x) / 2;
shell_y = (s_height - height - border_y) / 2;
gdk_window_move (GTK_WIDGET (shell)->window, shell_x, shell_y);
gdk_window_move (GTK_WIDGET (shell)->window,
MAX (0, shell_x), MAX (0, shell_y));
}
g_signal_handlers_unblock_by_func (G_OBJECT (shell->canvas),
......@@ -2189,7 +2192,7 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
if (disp_width != shell->disp_width ||
disp_height != shell->disp_height)
{
shell->offset_x += (disp_width - shell->disp_width) / 2;
shell->offset_x += (disp_width - shell->disp_width) / 2;
shell->offset_y += (disp_height - shell->disp_height) / 2;
}
}
......
......@@ -2169,13 +2169,16 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
gdk_window_get_origin (GTK_WIDGET (shell)->window, &shell_x, &shell_y);
/* if the window is offscreen, center it... */
if (shell_x > s_width || shell_y > s_height ||
(shell_x + width + border_x) < 0 || (shell_y + height + border_y) < 0)
if (shell_x > s_width ||
shell_y > s_height ||
(shell_x + width + border_x) < 0 ||
(shell_y + height + border_y) < 0)
{
shell_x = (s_width - width - border_x) >> 1;
shell_y = (s_height - height - border_y) >> 1;
shell_x = (s_width - width - border_x) / 2;
shell_y = (s_height - height - border_y) / 2;
gdk_window_move (GTK_WIDGET (shell)->window, shell_x, shell_y);
gdk_window_move (GTK_WIDGET (shell)->window,
MAX (0, shell_x), MAX (0, shell_y));
}
g_signal_handlers_unblock_by_func (G_OBJECT (shell->canvas),
......@@ -2189,7 +2192,7 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
if (disp_width != shell->disp_width ||
disp_height != shell->disp_height)
{
shell->offset_x += (disp_width - shell->disp_width) / 2;
shell->offset_x += (disp_width - shell->disp_width) / 2;
shell->offset_y += (disp_height - shell->disp_height) / 2;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment