From: Tor Lillqvist Date: Thu, 3 Nov 2005 13:44:37 +0000 (+0000) Subject: As there is only one GdkDisplay in the Win32 backend, check that X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=72ea12fec0696cedf3a24921a3c919021c2f1ab4;p=~andy%2Fgtk As there is only one GdkDisplay in the Win32 backend, check that 2005-11-03 Tor Lillqvist * gdk/win32/gdkcursor-win32.c: As there is only one GdkDisplay in the Win32 backend, check that GdkDisplay* parameters are equal to _gdk_display instead of using the unnecessarily general GDK_IS_DISPLAY(). --- diff --git a/ChangeLog b/ChangeLog index 07a6f7e87..f5fdd1969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,19 @@ 2005-11-03 Tor Lillqvist - * gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_alpha_winxp): - Rename the variables for the color bitmap to have "color" in their - name, for similarity with pixbuf_to_hbitmaps_normal(). Create a - color bitmap for the mask, too, instead of creating a b&w bitmap - with CreateBitmap(). Set up the mask bitmap's contents, ones for - those pixels in the color bitmap where the alpha is zero, zero for - other pixels. We used to use an unitialized mask bitmap! This - meant that icons and cursors created presumably worked more or - less by accident. Totally blank icons with zero alpha everywhere + * gdk/win32/gdkcursor-win32.c: As there is only one GdkDisplay in + the Win32 backend, check that GdkDisplay* parameters are equal to + _gdk_display instead of using the unnecessarily general + GDK_IS_DISPLAY(). + + (pixbuf_to_hbitmaps_alpha_winxp): Rename the variables for the + color bitmap to have "color" in their name, for similarity with + pixbuf_to_hbitmaps_normal(). Create a color bitmap for the mask, + too, instead of creating a b&w bitmap with CreateBitmap(). Set up + the mask bitmap's contents, ones for those pixels in the color + bitmap where the alpha is zero, zero for other pixels. We used to + use an unitialized mask bitmap! This meant that icons and cursors + created presumably worked more or less by accident. Totally blank + icons with zero alpha everywhere (as used by gtktrayicon.c) definitely did not work as expected. * gtk/Makefile.am: Include gtkstatusicon.c on all platforms. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 07a6f7e87..f5fdd1969 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,14 +1,19 @@ 2005-11-03 Tor Lillqvist - * gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_alpha_winxp): - Rename the variables for the color bitmap to have "color" in their - name, for similarity with pixbuf_to_hbitmaps_normal(). Create a - color bitmap for the mask, too, instead of creating a b&w bitmap - with CreateBitmap(). Set up the mask bitmap's contents, ones for - those pixels in the color bitmap where the alpha is zero, zero for - other pixels. We used to use an unitialized mask bitmap! This - meant that icons and cursors created presumably worked more or - less by accident. Totally blank icons with zero alpha everywhere + * gdk/win32/gdkcursor-win32.c: As there is only one GdkDisplay in + the Win32 backend, check that GdkDisplay* parameters are equal to + _gdk_display instead of using the unnecessarily general + GDK_IS_DISPLAY(). + + (pixbuf_to_hbitmaps_alpha_winxp): Rename the variables for the + color bitmap to have "color" in their name, for similarity with + pixbuf_to_hbitmaps_normal(). Create a color bitmap for the mask, + too, instead of creating a b&w bitmap with CreateBitmap(). Set up + the mask bitmap's contents, ones for those pixels in the color + bitmap where the alpha is zero, zero for other pixels. We used to + use an unitialized mask bitmap! This meant that icons and cursors + created presumably worked more or less by accident. Totally blank + icons with zero alpha everywhere (as used by gtktrayicon.c) definitely did not work as expected. * gtk/Makefile.am: Include gtkstatusicon.c on all platforms. diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c index 110506b74..0cdaf856f 100644 --- a/gdk/win32/gdkcursor-win32.c +++ b/gdk/win32/gdkcursor-win32.c @@ -136,7 +136,7 @@ gdk_cursor_new_for_display (GdkDisplay *display, { HCURSOR hcursor; - g_return_val_if_fail (display == gdk_display_get_default (), NULL); + g_return_val_if_fail (display == _gdk_display, NULL); hcursor = _gdk_win32_data_to_wcursor (cursor_type); @@ -365,7 +365,7 @@ gdk_cursor_new_from_name (GdkDisplay *display, HCURSOR hcursor = NULL; int i; - g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + g_return_val_if_fail (display == _gdk_display, NULL); for (i = 0; i < G_N_ELEMENTS(_default_cursors); i++) { @@ -520,7 +520,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display, { HCURSOR hcursor; - g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + g_return_val_if_fail (display == _gdk_display, NULL); g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); g_return_val_if_fail (0 <= x && x < gdk_pixbuf_get_width (pixbuf), NULL); g_return_val_if_fail (0 <= y && y < gdk_pixbuf_get_height (pixbuf), NULL); @@ -534,7 +534,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display, gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display) { - g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); + g_return_val_if_fail (display == _gdk_display, FALSE); return _gdk_win32_pixbuf_to_hicon_supports_alpha (); } @@ -542,7 +542,7 @@ gdk_display_supports_cursor_alpha (GdkDisplay *display) gboolean gdk_display_supports_cursor_color (GdkDisplay *display) { - g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); + g_return_val_if_fail (display == _gdk_display, FALSE); return TRUE; } @@ -550,7 +550,7 @@ gdk_display_supports_cursor_color (GdkDisplay *display) guint gdk_display_get_default_cursor_size (GdkDisplay *display) { - g_return_val_if_fail (GDK_IS_DISPLAY (display), 0); + g_return_val_if_fail (display == _gdk_display, FALSE); return MIN (GetSystemMetrics (SM_CXCURSOR), GetSystemMetrics (SM_CYCURSOR)); } @@ -560,7 +560,7 @@ gdk_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height) { - g_return_if_fail (GDK_IS_DISPLAY (display)); + g_return_val_if_fail (display == _gdk_display, FALSE); if (width) *width = GetSystemMetrics (SM_CXCURSOR);