Don't do anything if style doesn't change. Improve debugging output.

2008-05-23  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkwindow-win32.c (update_style_bits): Don't do
	anything if style doesn't change. Improve debugging output.


svn path=/trunk/; revision=20129
This commit is contained in:
Tor Lillqvist 2008-05-23 18:25:12 +00:00 committed by Tor Lillqvist
parent c75c6bf444
commit 5b8f0faa94
2 changed files with 31 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2008-05-23 Tor Lillqvist <tml@novell.com>
* 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 <mitch@gimp.org>
* perf/widgets.h
@ -150,8 +155,9 @@
2008-05-20 14:27:34 Tim Janik <timj@imendio.com>
* 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 <richard@imendio.com>

View File

@ -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;