[gtk+/gtk-2-24-quartz] Win32: Ensure native back-end for windows where the user requests their handle
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz] Win32: Ensure native back-end for windows where the user requests their handle
- Date: Wed, 23 Nov 2011 22:56:36 +0000 (UTC)
commit f16bc7f66d1ebd4b2e9d3d1cba1e5ebc4d6e0237
Author: Peter Clifton <pcjc2 cam ac uk>
Date: Fri Sep 9 15:17:29 2011 +0100
Win32: Ensure native back-end for windows where the user requests their handle
https://bugzilla.gnome.org/show_bug.cgi?id=658841
gdk/win32/gdkdrawable-win32.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index 52ab3fb..8e09be7 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -1962,6 +1962,26 @@ gdk_win32_get_visual (GdkDrawable *drawable)
HGDIOBJ
gdk_win32_drawable_get_handle (GdkDrawable *drawable)
{
+ if (GDK_IS_WINDOW (drawable))
+ {
+ GdkWindow *window = (GdkWindow *)drawable;
+
+ /* 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 " drawable is not a native Win32 window");
+ return NULL;
+ }
+ }
+ else if (!GDK_IS_PIXMAP (drawable))
+ {
+ g_warning (G_STRLOC " drawable is not a pixmap or window");
+ return NULL;
+ }
+
return GDK_DRAWABLE_HANDLE (drawable);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]