Win32: Ensure native back-end for windows where the user requests their handle

https://bugzilla.gnome.org/show_bug.cgi?id=658841
This commit is contained in:
Peter Clifton 2011-09-09 15:17:29 +01:00 committed by Alexander Larsson
parent b18718ac7e
commit f9d8f9758b

View File

@ -3409,5 +3409,15 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
HGDIOBJ HGDIOBJ
gdk_win32_window_get_handle (GdkWindow *window) gdk_win32_window_get_handle (GdkWindow *window)
{ {
/* Try to ensure the window has a native window */
if (!_gdk_window_has_impl (window))
gdk_window_ensure_native (window);
if (!GDK_WINDOW_IS_WIN32 (window))
{
g_warning (G_STRLOC " window is not a native Win32 window");
return NULL;
}
return GDK_WINDOW_HWND (window); return GDK_WINDOW_HWND (window);
} }