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 Hans Breuer
parent 0e781823cb
commit 2e08524481

View File

@ -61,8 +61,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
{
GdkWindowImplWin32 *impl;
GdkWindowObject *obj;
gboolean is_move;
gboolean is_resize;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
@ -70,9 +68,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
obj = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
is_move = (x - obj->x != 0) && (y - obj->y != 0);
is_resize = obj->width != width && obj->height != height;
GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
_gdk_win32_drawable_description (window),
obj->x, obj->y, width, height, x, y));
@ -96,19 +91,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),
obj->x + obj->parent->abs_x, obj->y + obj->parent->abs_y,
width, height,
(is_move ? "" : "|NOMOVE"),
(is_resize ? "" : "|NOSIZE")));
width, height));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
obj->x + obj->parent->abs_x, obj->y + obj->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_parent_bg (window);
_gdk_win32_window_tmp_reset_bg (window, TRUE);