[gtk+] win32: Avoid type warning for offscreen windows in xp theme



commit 213994b565d8587f03cff1c4c4db4ec7892487d0
Author: Martin Schlemmer <11285613 nwu ac za>
Date:   Mon Jun 14 20:47:57 2010 +0200

    win32: Avoid type warning for offscreen windows in xp theme
    
    See bug #598299

 gdk/gdk.symbols                       |    1 +
 gdk/win32/gdkwin32.h                  |    3 +++
 gdk/win32/gdkwindow-win32.c           |    6 ++++++
 modules/engines/ms-windows/xp_theme.c |    3 ++-
 4 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 5a36215..d0f8f72 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -1210,6 +1210,7 @@ gdk_window_destroy_notify
 #ifdef GDK_WINDOWING_WIN32
 #if IN_HEADER(__GDK_WIN32_H__)
 #if IN_FILE(__GDK_WINDOW_WIN32_C__)
+gdk_win32_window_is_win32
 gdk_win32_begin_direct_draw_libgtk_only
 gdk_win32_end_direct_draw_libgtk_only
 #endif
diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h
index 34fc537..5f769b0 100644
--- a/gdk/win32/gdkwin32.h
+++ b/gdk/win32/gdkwin32.h
@@ -73,6 +73,9 @@ G_BEGIN_DECLS
 #endif
 
 
+/* Return true if the GdkWindow is a win32 implemented window */
+gboolean      gdk_win32_window_is_win32 (GdkWindow *window);
+
 /* Return the Gdk* for a particular HANDLE */
 gpointer      gdk_win32_handle_table_lookup (GdkNativeWindow handle);
 
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 9161f6f..639d2fd 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -3378,6 +3378,12 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->destroy = _gdk_win32_window_destroy;
 }
 
+gboolean
+gdk_win32_window_is_win32 (GdkWindow *window)
+{
+  return GDK_WINDOW_IS_WIN32 (window);
+}
+
 GdkDrawable *
 gdk_win32_begin_direct_draw_libgtk_only (GdkDrawable *drawable,
 					 GdkGC *gc,
diff --git a/modules/engines/ms-windows/xp_theme.c b/modules/engines/ms-windows/xp_theme.c
index d217295..f864515 100755
--- a/modules/engines/ms-windows/xp_theme.c
+++ b/modules/engines/ms-windows/xp_theme.c
@@ -909,7 +909,8 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
     return FALSE;
 
   /* FIXME: Recheck its function */
-  enable_theme_dialog_texture_func (GDK_WINDOW_HWND (win), ETDT_ENABLETAB);
+  if (GDK_IS_WINDOW (win) && gdk_win32_window_is_win32 (win))
+    enable_theme_dialog_texture_func (GDK_WINDOW_HWND (win), ETDT_ENABLETAB);
 
   dc = get_window_dc (style, win, state_type, &dc_info,
 		      x, y, width, height,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]