[win32] Fix win32 theme crash on offscreen windows

We add _gdk_offscreen_window_get_real_drawable to get the real
pixmap impl for offscreen windows, then we use this
in gdkgc-win32.c:get_impl_drawable() for offscreen windows
This fixes a crash when rendering win32 theme parts on
offscreen windows (bug #623563)
This commit is contained in:
Alexander Larsson 2011-12-16 09:08:50 +01:00
parent f8170ee873
commit e9b0f9e81a
3 changed files with 9 additions and 0 deletions

View File

@ -685,6 +685,7 @@ typedef struct _GdkOffscreenWindow GdkOffscreenWindow;
#define GDK_OFFSCREEN_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindow))
#define GDK_IS_OFFSCREEN_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_OFFSCREEN_WINDOW))
GType gdk_offscreen_window_get_type (void);
GdkDrawable * _gdk_offscreen_window_get_real_drawable (GdkOffscreenWindow *window);
void _gdk_offscreen_window_new (GdkWindow *window,
GdkScreen *screen,
GdkVisual *visual,

View File

@ -842,6 +842,12 @@ gdk_offscreen_window_get_pointer (GdkWindow *window,
return TRUE;
}
GdkDrawable *
_gdk_offscreen_window_get_real_drawable (GdkOffscreenWindow *offscreen)
{
return get_real_drawable (offscreen);
}
/**
* gdk_offscreen_window_get_pixmap:
* @window: a #GdkWindow

View File

@ -743,6 +743,8 @@ predraw (GdkGC *gc,
static GdkDrawableImplWin32 *
get_impl_drawable (GdkDrawable *drawable)
{
if (GDK_IS_OFFSCREEN_WINDOW (drawable))
return _gdk_offscreen_window_get_real_drawable (GDK_OFFSCREEN_WINDOW (drawable));
if (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable))
return GDK_DRAWABLE_IMPL_WIN32(drawable);
else if (GDK_IS_WINDOW (drawable))