diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-10-03 22:12:41 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-10-03 22:12:41 +0000 |
commit | f903bdf1a745021df882b4f5ba2724e7536a3c5d (patch) | |
tree | 6c6d081a42a6c650a9a366caa4222ae9e0af2fe6 /gdk/gdk.c | |
parent | 344e8000a2d338719d6870faf4ca4e18bd2094ed (diff) | |
download | gtk+-f903bdf1a745021df882b4f5ba2724e7536a3c5d.tar.gz |
Fix a reference to window_private->destroyed.
Sun Oct 3 18:13:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_reset_shapes_recurse):
Fix a reference to window_private->destroyed.
* gtk/gtkplug.c (gtk_plug_realize): Fix up a direct
(ugly) setting of an internal GdkWindow member to use
a _slightly_ cleaner macro.
* gdk/gdkprivate.h: Split GdkWindowPrivate into
GdkDrawablePrivate and GdkWindowPrivate.
Add extra macros for accessing GDK_DRAWABLE_ components.
* *.[ch]: Massive adjustments for the above, use the
new macros in a lot of places.
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r-- | gdk/gdk.c | 33 |
1 files changed, 13 insertions, 20 deletions
@@ -47,6 +47,7 @@ #include "gdk.h" +#include "gdkx.h" #include "gdkprivate.h" #include "gdkinputprivate.h" @@ -493,10 +494,7 @@ gdk_pointer_grab (GdkWindow * window, GdkCursor * cursor, guint32 time) { - /* From gdkwindow.c */ gint return_val; - GdkWindowPrivate *window_private; - GdkWindowPrivate *confine_to_private; GdkCursorPrivate *cursor_private; guint xevent_mask; Window xwindow; @@ -505,17 +503,17 @@ gdk_pointer_grab (GdkWindow * window, int i; g_return_val_if_fail (window != NULL, 0); + g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0); - window_private = (GdkWindowPrivate*) window; - confine_to_private = (GdkWindowPrivate*) confine_to; cursor_private = (GdkCursorPrivate*) cursor; - xwindow = window_private->xwindow; + xwindow = GDK_DRAWABLE_XID (window); - if (!confine_to || confine_to_private->destroyed) + if (!confine_to || GDK_DRAWABLE_DESTROYED (confine_to)) xconfine_to = None; else - xconfine_to = confine_to_private->xwindow; + xconfine_to = GDK_DRAWABLE_XID (confine_to); if (!cursor) xcursor = None; @@ -541,8 +539,8 @@ gdk_pointer_grab (GdkWindow * window, if (return_val == Success) { - if (!window_private->destroyed) - return_val = XGrabPointer (window_private->xdisplay, + if (!GDK_DRAWABLE_DESTROYED (window)) + return_val = XGrabPointer (GDK_DRAWABLE_XDISPLAY (window), xwindow, owner_events, xevent_mask, @@ -555,7 +553,7 @@ gdk_pointer_grab (GdkWindow * window, } if (return_val == GrabSuccess) - gdk_xgrab_window = window_private; + gdk_xgrab_window = (GdkWindowPrivate *)window; return return_val; } @@ -631,17 +629,12 @@ gdk_keyboard_grab (GdkWindow * window, gint owner_events, guint32 time) { - GdkWindowPrivate *window_private; - Window xwindow; - g_return_val_if_fail (window != NULL, 0); + g_return_val_if_fail (GDK_IS_WINDOW (window), 0); - window_private = (GdkWindowPrivate*) window; - xwindow = window_private->xwindow; - - if (!window_private->destroyed) - return XGrabKeyboard (window_private->xdisplay, - xwindow, + if (!GDK_DRAWABLE_DESTROYED (window)) + return XGrabKeyboard (GDK_DRAWABLE_XDISPLAY (window), + GDK_DRAWABLE_XID (window), owner_events, GrabModeAsync, GrabModeAsync, time); |