Commit af9b53fc authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

Merge from stable:

2002-12-09  Tor Lillqvist  <tml@iki.fi>

	Merge from stable:

	* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
	stipple_gc. More checks for errors. Use correct ternary ROP when
	blitting the foreground into the tile pixmap onto those pixels
	where the stipple is set. (I didn't notice that I had used the
	wrong one, as it didn't matter on Win2k, where DIB sections
	apparently are zeroed upon creation. But on Win98 they have random
	initial contents. Thanks to Hans Breuer for reporting this.)
	(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
	gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
	generic_draw() if drawing a filled figure.

	* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
	(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
	(_gdk_win32_window_state_to_string): New debugging output helper
	function.

	* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
	(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
	SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
	WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
	unmapping on X11. Set window state correctly for all three of
	SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
	("minimized" in Windows terminology) window still has the
	"maximized" property, i.e. when deiconified, it will reappear as
	maximized. (#10557)

	* gdk/win32/gdkprivate-win32.h: Declare new function.
	(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
	__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.

	* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
	situations. Add parameter to tell whether deiconifying. Code
	reorg: Return early when appropriate instead of using nested if
	statements. If just deiconifying without raising, restore active
	window. (#10557)

	(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
	gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
	gdk_window_focus): Use _gdk_win32_window_state_to_string() in
	debugging output.

	(gdk_window_iconify): Restore active window after calling
	ShowWindow(). Otherwise the "next" window gets activated.

	(gdk_window_stick, gdk_window_unstick): Don't output any warnings.

	(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
	with GWL_HWNDPARENT, which despite its name sets the *owner*
	window, which should be exactly what we want. The PSDK
	documentation is said to be misleading. testgtk's modal window
	test now works much better. (#50586)
parent 016d6fad
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
Sun Dec 8 18:28:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_fg/bg/base/text/font):
......
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
Sun Dec 8 18:28:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_fg/bg/base/text/font):
......
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
Sun Dec 8 18:28:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_fg/bg/base/text/font):
......
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
Sun Dec 8 18:28:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_fg/bg/base/text/font):
......
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
Sun Dec 8 18:28:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_fg/bg/base/text/font):
......
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
Sun Dec 8 18:28:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_fg/bg/base/text/font):
......
......@@ -36,8 +36,8 @@
#include "gdkprivate-win32.h"
#define ROP3_D 0x00AA0029
#define ROP3_DPSao 0x00EA02E9
#define ROP3_DSna 0x00220326
#define ROP3_DSPDxax 0x00E20746
#define LINE_ATTRIBUTES (GDK_GC_LINE_WIDTH|GDK_GC_LINE_STYLE| \
GDK_GC_CAP_STYLE|GDK_GC_JOIN_STYLE)
......@@ -536,6 +536,7 @@ generic_draw (GdkDrawable *drawable,
gdk_draw_rectangle (tile_pixmap, tile_gc, TRUE,
0, 0, width, height);
}
gdk_gc_unref (stipple_gc);
}
gdk_gc_unref (mask_gc);
......@@ -552,19 +553,49 @@ generic_draw (GdkDrawable *drawable,
if (gcwin32->fill_style == GDK_STIPPLED ||
gcwin32->fill_style == GDK_OPAQUE_STIPPLED)
{
HDC stipple_hdc = CreateCompatibleDC (hdc);
HGDIOBJ old_stipple_hbm = SelectObject (stipple_hdc, GDK_PIXMAP_HBITMAP (stipple_bitmap));
HBRUSH fg_brush = CreateSolidBrush
(_gdk_win32_colormap_color (impl->colormap, gcwin32->foreground));
HGDIOBJ old_tile_brush = SelectObject (tile_hdc, fg_brush);
/* Paint tile with foreround where stipple is one */
HDC stipple_hdc;
HGDIOBJ old_stipple_hbm;
HBRUSH fg_brush;
HGDIOBJ old_tile_brush;
if ((stipple_hdc = CreateCompatibleDC (hdc)) == NULL)
WIN32_GDI_FAILED ("CreateCompatibleDC");
if ((old_stipple_hbm =
SelectObject (stipple_hdc,
GDK_PIXMAP_HBITMAP (stipple_bitmap))) == NULL)
WIN32_GDI_FAILED ("SelectObject");
if ((fg_brush = CreateSolidBrush
(_gdk_win32_colormap_color (impl->colormap,
gcwin32->foreground))) == NULL)
WIN32_GDI_FAILED ("CreateSolidBrush");
if ((old_tile_brush = SelectObject (tile_hdc, fg_brush)) == NULL)
WIN32_GDI_FAILED ("SelectObject");
/* Paint tile with foreround where stipple is one
*
* Desired ternary ROP: (P=foreground, S=stipple, D=destination)
* P S D ?
* 0 0 0 0
* 0 0 1 1
* 0 1 0 0
* 0 1 1 0
* 1 0 0 0
* 1 0 1 1
* 1 1 0 1
* 1 1 1 1
*
* Reading bottom-up: 11100010 = 0xE2. PSDK docs say this is
* known as DSPDxax, with hex value 0x00E20746.
*/
GDI_CALL (BitBlt, (tile_hdc, 0, 0, width, height,
stipple_hdc, 0, 0, ROP3_DPSao));
stipple_hdc, 0, 0, ROP3_DSPDxax));
if (gcwin32->fill_style == GDK_STIPPLED)
{
/* Punch holes in mask where stipple bitmap is zero */
/* Punch holes in mask where stipple is zero */
GDI_CALL (BitBlt, (mask_hdc, 0, 0, width, height,
stipple_hdc, 0, 0, SRCAND));
}
......@@ -754,7 +785,8 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable,
bounds.height = height;
region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width);
generic_draw (drawable, gc, GDK_GC_FOREGROUND|LINE_ATTRIBUTES,
generic_draw (drawable, gc,
GDK_GC_FOREGROUND | (filled ? 0 : LINE_ATTRIBUTES),
draw_rectangle, region, filled, x, y, width, height);
gdk_region_destroy (region);
......@@ -857,7 +889,8 @@ gdk_win32_draw_arc (GdkDrawable *drawable,
bounds.height = height;
region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width);
generic_draw (drawable, gc, GDK_GC_FOREGROUND|LINE_ATTRIBUTES,
generic_draw (drawable, gc,
GDK_GC_FOREGROUND | (filled ? 0 : LINE_ATTRIBUTES),
draw_arc, region, filled, x, y, width, height, angle1, angle2);
gdk_region_destroy (region);
......@@ -938,7 +971,8 @@ gdk_win32_draw_polygon (GdkDrawable *drawable,
region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width);
generic_draw (drawable, gc, GDK_GC_FOREGROUND|LINE_ATTRIBUTES,
generic_draw (drawable, gc,
GDK_GC_FOREGROUND | (filled ? 0 : LINE_ATTRIBUTES),
draw_polygon, region, filled, pts, npoints);
gdk_region_destroy (region);
......
......@@ -1009,17 +1009,6 @@ print_event_state (gint state)
#undef CASE
}
static void
print_window_state (GdkWindowState state)
{
#define CASE(bit) if (state & GDK_WINDOW_STATE_ ## bit ) g_print (#bit " ");
CASE (WITHDRAWN);
CASE (ICONIFIED);
CASE (MAXIMIZED);
CASE (STICKY);
#undef CASE
}
static void
print_event (GdkEvent *event)
{
......@@ -1127,8 +1116,9 @@ print_event (GdkEvent *event)
print_event_state (event->scroll.state);
break;
case GDK_WINDOW_STATE:
print_window_state (event->window_state.changed_mask);
print_window_state (event->window_state.new_window_state);
g_print ("%s: %s",
_gdk_win32_window_state_to_string (event->window_state.changed_mask),
_gdk_win32_window_state_to_string (event->window_state.new_window_state));
default:
/* Nothing */
break;
......@@ -2946,6 +2936,10 @@ gdk_event_translate (GdkDisplay *display,
if (!(private->event_mask & GDK_STRUCTURE_MASK))
break;
if (msg->lParam == SW_OTHERUNZOOM ||
msg->lParam == SW_OTHERZOOM)
break;
event->any.type = (msg->wParam ? GDK_MAP : GDK_UNMAP);
event->any.window = window;
......@@ -2971,13 +2965,9 @@ gdk_event_translate (GdkDisplay *display,
(msg->wParam == SIZE_RESTORED ? "RESTORED" : "?"))))),
LOWORD (msg->lParam), HIWORD (msg->lParam)));
if (!(private->event_mask & GDK_STRUCTURE_MASK))
break;
if (msg->wParam == SIZE_MINIMIZED)
{
event->any.type = GDK_UNMAP;
event->any.window = window;
/* Don't generate any GDK event. This is *not* an UNMAP. */
if (p_grab_window == window)
gdk_pointer_ungrab (msg->time);
......@@ -2985,12 +2975,9 @@ gdk_event_translate (GdkDisplay *display,
if (k_grab_window == window)
gdk_keyboard_ungrab (msg->time);
if (window && GDK_WINDOW_IS_MAPPED (window))
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED,
GDK_WINDOW_STATE_ICONIFIED);
return_val = !GDK_WINDOW_DESTROYED (window);
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_WITHDRAWN,
GDK_WINDOW_STATE_ICONIFIED);
}
else if ((msg->wParam == SIZE_RESTORED
|| msg->wParam == SIZE_MAXIMIZED)
......@@ -2999,6 +2986,9 @@ gdk_event_translate (GdkDisplay *display,
#endif
)
{
if (!(private->event_mask & GDK_STRUCTURE_MASK))
break;
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
pt.x = 0;
......@@ -3016,11 +3006,13 @@ gdk_event_translate (GdkDisplay *display,
if (msg->wParam == SIZE_RESTORED)
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_ICONIFIED |
GDK_WINDOW_STATE_MAXIMIZED,
GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_WITHDRAWN,
0);
else if (msg->wParam == SIZE_MAXIMIZED)
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_ICONIFIED,
GDK_WINDOW_STATE_ICONIFIED |
GDK_WINDOW_STATE_WITHDRAWN,
GDK_WINDOW_STATE_MAXIMIZED);
if (private->resize_count > 1)
......
......@@ -360,7 +360,7 @@ _gdk_win32_print_dc (HDC hdc)
RECT rect;
int flag;
g_print ("%p\n", hdc);
g_print ("%p:\n", hdc);
obj = GetCurrentObject (hdc, OBJ_BRUSH);
GetObject (obj, sizeof (LOGBRUSH), &logbrush);
g_print ("brush: %s color=%06lx hatch=%p\n",
......@@ -493,6 +493,8 @@ _gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
gchar *bufp = buf;
gchar *s = "";
buf[0] = '\0';
#define BIT(x) \
if (mask & GDK_GC_##x) \
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
......@@ -520,6 +522,32 @@ _gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
return static_printf ("%s", buf);
}
gchar *
_gdk_win32_window_state_to_string (GdkWindowState state)
{
gchar buf[100];
gchar *bufp = buf;
gchar *s = "";
buf[0] = '\0';
#define BIT(x) \
if (state & GDK_WINDOW_STATE_ ## x) \
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
/* For clarity, also show the complement of WITHDRAWN, i.e. "MAPPED" */
if (!(state & GDK_WINDOW_STATE_WITHDRAWN))
(bufp += sprintf (bufp, "MAPPED"), s = "|");
BIT (WITHDRAWN);
BIT (ICONIFIED);
BIT (MAXIMIZED);
BIT (STICKY);
#undef BIT
return static_printf ("%s", buf);
}
gchar *
_gdk_win32_rop2_to_string (int rop2)
{
......
......@@ -405,6 +405,7 @@ gchar *_gdk_win32_function_to_string (GdkFunction function);
gchar *_gdk_win32_join_style_to_string (GdkJoinStyle join_style);
gchar *_gdk_win32_line_style_to_string (GdkLineStyle line_style);
gchar *_gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask);
gchar *_gdk_win32_window_state_to_string (GdkWindowState state);
gchar *_gdk_win32_drawable_description (GdkDrawable *d);
gchar *_gdk_win32_rop2_to_string (int rop2);
......@@ -432,7 +433,7 @@ void _gdk_win32_gdi_failed (const gchar *where,
gint line,
const gchar *api);
#ifdef __GNUC__
#if defined(__GNUC__) && (__GNUC__ < 3)
#define WIN32_API_FAILED(api) _gdk_win32_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
#define WIN32_GDI_FAILED(api) _gdk_win32_gdi_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
#define OTHER_API_FAILED(api) _gdk_other_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
......
......@@ -810,59 +810,81 @@ gdk_window_destroy_notify (GdkWindow *window)
static void
show_window_internal (GdkWindow *window,
gboolean raise)
gboolean raise,
gboolean deiconify)
{