win32: Never pass SWP_NOSIZE or SWP_NOMOVE to SetWindowPos

In _gdk_window_move_resize_child it tries to decide whether to pass
SWP_NOSIZE and SWP_NOMOVE based on whether the new size and position
is different from the window's existing position. However it seems
that GDK now ends up updating the window's position before calling
_gdk_window_move_resize_child so this would mean it would think the
window never changes size or position so SWP_NOSIZE|SWP_NOMOVE would
always be set. This causes child windows to never be resized.

This patch changes it so that it never passes either flag to
SetWindowPos. I don't know whether this will cause any side effects
but you'd think it shouldn't do any harm to reassert the current size.

https://bugzilla.gnome.org/show_bug.cgi?id=628049

Signed-off-by: Hans Breuer <hans@breuer.org>
This commit is contained in:
Neil Roberts 2010-08-26 19:02:00 +01:00 committed by Alexander Larsson
parent 06a20d207a
commit 7445a59a9a

View File

@ -59,17 +59,12 @@ _gdk_window_move_resize_child (GdkWindow *window,
gint height)
{
GdkWindowImplWin32 *impl;
gboolean is_move;
gboolean is_resize;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
is_move = (x - window->x != 0) && (y - window->y != 0);
is_resize = window->width != width && window->height != height;
GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
_gdk_win32_window_description (window),
window->x, window->y, width, height, x, y));
@ -93,19 +88,15 @@ _gdk_window_move_resize_child (GdkWindow *window,
_gdk_win32_window_tmp_unset_bg (window, TRUE);
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
"NOACTIVATE|NOZORDER%s%s)\n",
"NOACTIVATE|NOZORDER)\n",
GDK_WINDOW_HWND (window),
window->x + window->parent->abs_x, window->y + window->parent->abs_y,
width, height,
(is_move ? "" : "|NOMOVE"),
(is_resize ? "" : "|NOSIZE")));
width, height));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
window->x + window->parent->abs_x, window->y + window->parent->abs_y,
width, height,
SWP_NOACTIVATE | SWP_NOZORDER |
(is_move ? 0 : SWP_NOMOVE) |
(is_resize ? 0 : SWP_NOSIZE)));
SWP_NOACTIVATE | SWP_NOZORDER));
_gdk_win32_window_tmp_reset_bg (window, TRUE);
}