diff --git a/ChangeLog b/ChangeLog index 11c442e20a..537f4888e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-23 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (update_style_bits): Don't do + anything if style doesn't change. Improve debugging output. + 2008-05-23 Michael Natterer * perf/widgets.h @@ -150,8 +155,9 @@ 2008-05-20 14:27:34 Tim Janik - * reverted recent unapproved changes by Yair Hershkovitz, regarding: - Bug 503071 – Application direction changes to right to left even if theres no translation. + * reverted recent unapproved changes by Yair Hershkovitz, + regarding: Bug 503071 – Application direction changes to right + to left even if theres no translation. 2008-05-19 Richard Hult diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 19762350bc..2ead9ee946 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -2886,35 +2886,44 @@ static void update_style_bits (GdkWindow *window) { GdkWMDecoration decorations; - LONG style, exstyle; + LONG old_style, new_style, exstyle; gboolean all; RECT rect, before, after; - style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); + old_style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); GetClientRect (GDK_WINDOW_HWND (window), &before); after = before; - AdjustWindowRectEx (&before, style, FALSE, exstyle); - - GDK_NOTE (MISC, g_print ("update_style_bits: style: %s", _gdk_win32_window_style_to_string (style))); + AdjustWindowRectEx (&before, old_style, FALSE, exstyle); + new_style = old_style; if (get_effective_window_decorations (window, &decorations)) { all = (decorations & GDK_DECOR_ALL); - update_single_bit (&style, all, decorations & GDK_DECOR_BORDER, WS_BORDER); - update_single_bit (&style, all, decorations & GDK_DECOR_RESIZEH, WS_THICKFRAME); - update_single_bit (&style, all, decorations & GDK_DECOR_TITLE, WS_CAPTION); - update_single_bit (&style, all, decorations & GDK_DECOR_MENU, WS_SYSMENU); - update_single_bit (&style, all, decorations & GDK_DECOR_MINIMIZE, WS_MINIMIZEBOX); - update_single_bit (&style, all, decorations & GDK_DECOR_MAXIMIZE, WS_MAXIMIZEBOX); + update_single_bit (&new_style, all, decorations & GDK_DECOR_BORDER, WS_BORDER); + update_single_bit (&new_style, all, decorations & GDK_DECOR_RESIZEH, WS_THICKFRAME); + update_single_bit (&new_style, all, decorations & GDK_DECOR_TITLE, WS_CAPTION); + update_single_bit (&new_style, all, decorations & GDK_DECOR_MENU, WS_SYSMENU); + update_single_bit (&new_style, all, decorations & GDK_DECOR_MINIMIZE, WS_MINIMIZEBOX); + update_single_bit (&new_style, all, decorations & GDK_DECOR_MAXIMIZE, WS_MAXIMIZEBOX); } - GDK_NOTE (MISC, g_print (" => %s\n", _gdk_win32_window_style_to_string (style))); + if (old_style == new_style) + { + GDK_NOTE (MISC, g_print ("update_style_bits: %p: no change\n", + GDK_WINDOW_HWND (window))); + return; + } - SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, style); + GDK_NOTE (MISC, g_print ("update_style_bits: %p: %s => %s\n", + GDK_WINDOW_HWND (window), + _gdk_win32_window_style_to_string (old_style), + _gdk_win32_window_style_to_string (new_style))); - AdjustWindowRectEx (&after, style, FALSE, exstyle); + SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, new_style); + + AdjustWindowRectEx (&after, new_style, FALSE, exstyle); GetWindowRect (GDK_WINDOW_HWND (window), &rect); rect.left += after.left - before.left;