added a bunch of checks for window != NULL and private->destroyed. (don't

Mon Jan 26 02:15:29 1998  Tim Janik  <timj@gimp.org>

        * gdk/gdkdraw.c:
        * gdk/gdkgc.c:
        * gdk/gdkimage.c:
        * gdk/gdkinput.c:
        * gdk/gdkpixmap.c:
        * gdk/gdkproperty.c:
        * gdk/gdkselection.c:
        * gdk/gdkwindow.c: added a bunch of checks for window != NULL and
          private->destroyed.
(don't trust this cvs commit message, i didn't modify that many files!)
This commit is contained in:
Tim Janik 1998-01-26 01:20:14 +00:00 committed by Tim Janik
parent 63f6c689ff
commit f734007af4
23 changed files with 563 additions and 203 deletions

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1,3 +1,15 @@
Mon Jan 26 02:15:29 1998 Tim Janik <timj@gimp.org>
* gdk/gdkdraw.c:
* gdk/gdkgc.c:
* gdk/gdkimage.c:
* gdk/gdkinput.c:
* gdk/gdkpixmap.c:
* gdk/gdkproperty.c:
* gdk/gdkselection.c:
* gdk/gdkwindow.c: added a bunch of checks for window != NULL and
private->destroyed.
Sun Jan 25 19:15:32 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.h (enum): added new widget flag GTK_LEAVE_PENDING.

View File

@ -1248,7 +1248,7 @@ gdk_pointer_grab (GdkWindow * window,
xwindow = window_private->xwindow;
if (!confine_to)
if (!confine_to || confine_to_private->destroyed)
xconfine_to = None;
else
xconfine_to = confine_to_private->xwindow;
@ -1277,14 +1277,17 @@ gdk_pointer_grab (GdkWindow * window,
return_val = Success;;
if (return_val == Success)
return_val = XGrabPointer (window_private->xdisplay,
xwindow,
owner_events,
xevent_mask,
GrabModeAsync, GrabModeAsync,
xconfine_to,
xcursor,
time);
if (!window_private->destroyed)
return_val = XGrabPointer (window_private->xdisplay,
xwindow,
owner_events,
xevent_mask,
GrabModeAsync, GrabModeAsync,
xconfine_to,
xcursor,
time);
else
return_val = AlreadyGrabbed;
if (return_val == GrabSuccess)
xgrab_window = window_private;
@ -1371,11 +1374,14 @@ gdk_keyboard_grab (GdkWindow * window,
window_private = (GdkWindowPrivate*) window;
xwindow = window_private->xwindow;
return XGrabKeyboard (window_private->xdisplay,
xwindow,
owner_events,
GrabModeAsync, GrabModeAsync,
time);
if (!window_private->destroyed)
return XGrabKeyboard (window_private->xdisplay,
xwindow,
owner_events,
GrabModeAsync, GrabModeAsync,
time);
else
return AlreadyGrabbed;
}
/*

View File

@ -34,6 +34,8 @@ gdk_draw_point (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawPoint (drawable_private->xdisplay, drawable_private->xwindow,
@ -55,6 +57,8 @@ gdk_draw_line (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawLine (drawable_private->xdisplay, drawable_private->xwindow,
@ -77,6 +81,8 @@ gdk_draw_rectangle (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@ -110,6 +116,8 @@ gdk_draw_arc (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@ -139,6 +147,8 @@ gdk_draw_polygon (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
if (filled)
@ -183,6 +193,8 @@ gdk_draw_string (GdkDrawable *drawable,
g_return_if_fail (string != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@ -237,6 +249,8 @@ gdk_draw_text (GdkDrawable *drawable,
g_return_if_fail (text != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@ -286,6 +300,8 @@ gdk_draw_pixmap (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
src_private = (GdkWindowPrivate*) src;
if (drawable_private->destroyed || src_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@ -346,6 +362,8 @@ gdk_draw_points (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawPoints (drawable_private->xdisplay,
@ -373,6 +391,8 @@ gdk_draw_segments (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawSegments (drawable_private->xdisplay,

View File

@ -32,17 +32,24 @@ gdk_gc_new_with_values (GdkWindow *window,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
GdkWindowPrivate *window_private;
GdkGC *gc;
GdkGCPrivate *private;
Window xwindow;
XGCValues xvalues;
unsigned long xvalues_mask;
g_return_val_if_fail (window != NULL, NULL);
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
private = g_new (GdkGCPrivate, 1);
gc = (GdkGC*) private;
xwindow = ((GdkWindowPrivate*) window)->xwindow;
private->xdisplay = ((GdkWindowPrivate*) window)->xdisplay;
xwindow = window_private->xwindow;
private->xdisplay = window_private->xdisplay;
xvalues.function = GXcopy;
xvalues.fill_style = FillSolid;
@ -512,15 +519,22 @@ gdk_gc_set_clip_mask (GdkGC *gc,
{
GdkGCPrivate *private;
Pixmap xmask;
g_return_if_fail (gc != NULL);
private = (GdkGCPrivate*) gc;
if (mask)
xmask = ((GdkWindowPrivate*) mask)->xwindow;
{
GdkWindowPrivate *mask_private;
mask_private = (GdkWindowPrivate*) mask;
if (mask_private->destroyed)
return;
xmask = mask_private->xwindow;
}
else
xmask = None;
private = (GdkGCPrivate*) gc;
XSetClipMask (private->xdisplay, private->xgc, xmask);
}

View File

@ -330,6 +330,8 @@ gdk_image_get (GdkWindow *window,
g_return_val_if_fail (window != NULL, NULL);
win_private = (GdkWindowPrivate *) window;
if (win_private->destroyed)
return NULL;
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
@ -447,6 +449,8 @@ gdk_image_put_normal (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
image_private = (GdkImagePrivate*) image;
gc_private = (GdkGCPrivate*) gc;
@ -478,6 +482,8 @@ gdk_image_put_shared (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
image_private = (GdkImagePrivate*) image;
gc_private = (GdkGCPrivate*) gc;

View File

@ -118,14 +118,20 @@ gdk_input_motion_events (GdkWindow *window,
guint32 stop,
gint *nevents_return)
{
GdkWindowPrivate *window_private;
XTimeCoord *xcoords;
GdkTimeCoord *coords;
int i;
g_return_val_if_fail (window != NULL, NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return NULL;
if (deviceid == GDK_CORE_POINTER)
{
xcoords = XGetMotionEvents (gdk_display,
((GdkWindowPrivate *)window)->xwindow,
window_private->xwindow,
start, stop, nevents_return);
if (xcoords)
{
@ -204,10 +210,14 @@ void
gdk_input_set_extension_events (GdkWindow *window, gint mask,
GdkExtensionMode mode)
{
GdkWindowPrivate *window_private;
GList *tmp_list;
GdkInputWindow *iw;
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
@ -224,7 +234,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
iw->grabbed = FALSE;
gdk_input_windows = g_list_append(gdk_input_windows,iw);
((GdkWindowPrivate *)window)->extension_events = mask;
window_private->extension_events = mask;
/* Add enter window events to the event mask */
/* FIXME, this is not needed for XINPUT_NONE */
@ -241,7 +251,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
g_free(iw);
}
((GdkWindowPrivate *)window)->extension_events = 0;
window_private->extension_events = 0;
}
for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next)

View File

@ -46,14 +46,16 @@ gdk_pixmap_new (GdkWindow *window,
if (!window)
window = (GdkWindow*) &gdk_root_parent;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
if (depth == -1)
gdk_window_get_geometry (window, NULL, NULL, NULL, NULL, &depth);
private = g_new (GdkWindowPrivate, 1);
pixmap = (GdkPixmap*) private;
window_private = (GdkWindowPrivate*) window;
private->xdisplay = window_private->xdisplay;
private->window_type = GDK_WINDOW_PIXMAP;
private->xwindow = XCreatePixmap (private->xdisplay, window_private->xwindow,
@ -87,11 +89,13 @@ gdk_bitmap_create_from_data (GdkWindow *window,
if (!window)
window = (GdkWindow*) &gdk_root_parent;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
private = g_new (GdkWindowPrivate, 1);
pixmap = (GdkPixmap*) private;
window_private = (GdkWindowPrivate*) window;
private->parent = NULL;
private->xdisplay = window_private->xdisplay;
private->window_type = GDK_WINDOW_PIXMAP;
@ -132,14 +136,16 @@ gdk_pixmap_create_from_data (GdkWindow *window,
if (!window)
window = (GdkWindow*) &gdk_root_parent;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
if (depth == -1)
gdk_window_get_geometry (window, NULL, NULL, NULL, NULL, &depth);
private = g_new (GdkWindowPrivate, 1);
pixmap = (GdkPixmap*) private;
window_private = (GdkWindowPrivate*) window;
private->parent = NULL;
private->xdisplay = window_private->xdisplay;
private->window_type = GDK_WINDOW_PIXMAP;

View File

@ -67,7 +67,6 @@ gdk_property_get (GdkWindow *window,
gint *actual_length,
guchar **data)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
Atom ret_prop_type;
@ -79,7 +78,12 @@ gdk_property_get (GdkWindow *window,
if (window)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return FALSE;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
@ -156,13 +160,17 @@ gdk_property_change (GdkWindow *window,
guchar *data,
gint nelements)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
if (window)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
@ -180,13 +188,17 @@ void
gdk_property_delete (GdkWindow *window,
GdkAtom property)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
if (window)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}

View File

@ -29,13 +29,17 @@ gdk_selection_owner_set (GdkWindow *owner,
guint32 time,
gint send_event)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
if (owner)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) owner;
if (private->destroyed)
return FALSE;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
@ -73,6 +77,8 @@ gdk_selection_convert (GdkWindow *requestor,
g_return_if_fail (requestor != NULL);
private = (GdkWindowPrivate*) requestor;
if (private->destroyed)
return;
XConvertSelection (private->xdisplay, selection, target,
gdk_selection_property, private->xwindow, time);
@ -99,6 +105,8 @@ gdk_selection_property_get (GdkWindow *requestor,
moderate length, to avoid two round trips to the server */
private = (GdkWindowPrivate*) requestor;
if (private->destroyed)
return 0;
XGetWindowProperty (private->xdisplay, private->xwindow,
gdk_selection_property, 0, 0, False,

View File

@ -103,6 +103,9 @@ gdk_window_new (GdkWindow *parent,
parent = (GdkWindow*) &gdk_root_parent;
parent_private = (GdkWindowPrivate*) parent;
if (parent_private->destroyed)
return NULL;
xparent = parent_private->xwindow;
parent_display = parent_private->xdisplay;
@ -508,12 +511,15 @@ gdk_window_move (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
XMoveWindow (private->xdisplay, private->xwindow, x, y);
if (private->window_type == GDK_WINDOW_CHILD)
if (!private->destroyed)
{
private->x = x;
private->y = y;
XMoveWindow (private->xdisplay, private->xwindow, x, y);
if (private->window_type == GDK_WINDOW_CHILD)
{
private->x = x;
private->y = y;
}
}
}
@ -566,15 +572,17 @@ gdk_window_move_resize (GdkWindow *window,
height = 1;
private = (GdkWindowPrivate*) window;
XMoveResizeWindow (private->xdisplay, private->xwindow, x, y, width, height);
if (!private->destroyed &&
(private->window_type == GDK_WINDOW_CHILD))
if (!private->destroyed)
{
private->x = x;
private->y = y;
private->width = width;
private->height = height;
XMoveResizeWindow (private->xdisplay, private->xwindow, x, y, width, height);
if (private->window_type == GDK_WINDOW_CHILD)
{
private->x = x;
private->y = y;
private->width = width;
private->height = height;
}
}
}
@ -595,10 +603,11 @@ gdk_window_reparent (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
parent_private = (GdkWindowPrivate*) new_parent;
XReparentWindow (window_private->xdisplay,
window_private->xwindow,
parent_private->xwindow,
x, y);
if (!window_private->destroyed && !parent_private->destroyed)
XReparentWindow (window_private->xdisplay,
window_private->xwindow,
parent_private->xwindow,
x, y);
}
void
@ -610,7 +619,8 @@ gdk_window_clear (GdkWindow *window)
private = (GdkWindowPrivate*) window;
XClearWindow (private->xdisplay, private->xwindow);
if (!private->destroyed)
XClearWindow (private->xdisplay, private->xwindow);
}
void
@ -621,11 +631,11 @@ gdk_window_clear_area (GdkWindow *window,
gint height)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (!private->destroyed)
XClearArea (private->xdisplay, private->xwindow,
x, y, width, height, False);
@ -641,9 +651,9 @@ gdk_window_clear_area_e (GdkWindow *window,
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (!private->destroyed)
XClearArea (private->xdisplay, private->xwindow,
x, y, width, height, True);
@ -735,6 +745,9 @@ gdk_window_set_hints (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
size_hints.flags = 0;
if (flags & GDK_HINT_POS)
@ -771,8 +784,9 @@ gdk_window_set_title (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
XmbSetWMProperties (private->xdisplay, private->xwindow,
title, title, NULL, 0, NULL, NULL, NULL);
if (!private->destroyed)
XmbSetWMProperties (private->xdisplay, private->xwindow,
title, title, NULL, 0, NULL, NULL, NULL);
}
void
@ -784,7 +798,8 @@ gdk_window_set_background (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
XSetWindowBackground (private->xdisplay, private->xwindow, color->pixel);
if (!private->destroyed)
XSetWindowBackground (private->xdisplay, private->xwindow, color->pixel);
}
void
@ -809,7 +824,8 @@ gdk_window_set_back_pixmap (GdkWindow *window,
if (parent_relative)
xpixmap = ParentRelative;
XSetWindowBackgroundPixmap (window_private->xdisplay, window_private->xwindow, xpixmap);
if (!window_private->destroyed)
XSetWindowBackgroundPixmap (window_private->xdisplay, window_private->xwindow, xpixmap);
}
void
@ -830,7 +846,8 @@ gdk_window_set_cursor (GdkWindow *window,
else
xcursor = cursor_private->xcursor;
XDefineCursor (window_private->xdisplay, window_private->xwindow, xcursor);
if (!window_private->destroyed)
XDefineCursor (window_private->xdisplay, window_private->xwindow, xcursor);
}
void
@ -846,12 +863,15 @@ gdk_window_set_colormap (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
colormap_private = (GdkColormapPrivate*) colormap;
XSetWindowColormap (window_private->xdisplay,
window_private->xwindow,
colormap_private->xcolormap);
if (window_private->window_type != GDK_WINDOW_TOPLEVEL)
gdk_window_add_colormap_windows (window);
if (!window_private->destroyed)
{
XSetWindowColormap (window_private->xdisplay,
window_private->xwindow,
colormap_private->xcolormap);
if (window_private->window_type != GDK_WINDOW_TOPLEVEL)
gdk_window_add_colormap_windows (window);
}
}
void
@ -885,19 +905,22 @@ gdk_window_get_geometry (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
XGetGeometry (window_private->xdisplay, window_private->xwindow,
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
*x = tx;
if (y)
*y = ty;
if (width)
*width = twidth;
if (height)
*height = theight;
if (depth)
*depth = tdepth;
if (!window_private->destroyed)
{
XGetGeometry (window_private->xdisplay, window_private->xwindow,
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
*x = tx;
if (y)
*y = ty;
if (width)
*width = twidth;
if (height)
*height = theight;
if (depth)
*depth = tdepth;
}
}
void
@ -947,7 +970,7 @@ gdk_window_get_visual (GdkWindow *window)
while (window_private && (window_private->window_type == GDK_WINDOW_PIXMAP))
window_private = (GdkWindowPrivate*) window_private->parent;
if (window_private)
if (window_private && !window_private->destroyed)
{
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
@ -969,11 +992,16 @@ gdk_window_get_colormap (GdkWindow *window)
window_private = (GdkWindowPrivate*) window;
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
&window_attributes);
if (!window_private->destroyed)
{
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
&window_attributes);
return gdk_colormap_lookup (window_attributes.colormap);
}
return gdk_colormap_lookup (window_attributes.colormap);
return NULL;
}
GdkWindowType
@ -1001,17 +1029,22 @@ gdk_window_get_origin (GdkWindow *window,
private = (GdkWindowPrivate*) window;
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
gdk_root_window,
0, 0, &tx, &ty,
&child);
if (x)
*x = tx;
if (y)
*y = ty;
if (!private->destroyed)
{
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
gdk_root_window,
0, 0, &tx, &ty,
&child);
if (x)
*x = tx;
if (y)
*y = ty;
}
else
return_val = 0;
return return_val;
}
@ -1035,17 +1068,18 @@ gdk_window_get_pointer (GdkWindow *window,
private = (GdkWindowPrivate*) window;
return_val = NULL;
if (XQueryPointer (private->xdisplay, private->xwindow, &root, &child,
if (!private->destroyed &&
XQueryPointer (private->xdisplay, private->xwindow, &root, &child,
&rootx, &rooty, &winx, &winy, &xmask))
{
if (x) *x = winx;
if (y) *y = winy;
if (mask) *mask = xmask;
if (child)
return_val = gdk_window_lookup (child);
}
return return_val;
}
@ -1090,6 +1124,8 @@ gdk_window_get_children (GdkWindow *window)
g_return_val_if_fail (window != NULL, NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return NULL;
XQueryTree (private->xdisplay, private->xwindow,
&root, &parent, &xchildren, &nchildren);
@ -1114,11 +1150,18 @@ gdk_window_get_children (GdkWindow *window)
GdkEventMask
gdk_window_get_events (GdkWindow *window)
{
GdkWindowPrivate *private;
XWindowAttributes attrs;
GdkEventMask event_mask;
int i;
XGetWindowAttributes (gdk_display, ((GdkWindowPrivate *)window)->xwindow,
g_return_val_if_fail (window != NULL, 0);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return 0;
XGetWindowAttributes (gdk_display, private->xwindow,
&attrs);
event_mask = 0;
@ -1135,9 +1178,16 @@ void
gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
GdkWindowPrivate *private;
long xevent_mask;
int i;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xevent_mask = StructureNotifyMask;
for (i = 0; i < nevent_masks; i++)
{
@ -1145,7 +1195,7 @@ gdk_window_set_events (GdkWindow *window,
xevent_mask |= event_mask_table[i];
}
XSelectInput (gdk_display, ((GdkWindowPrivate *)window)->xwindow,
XSelectInput (gdk_display, private->xwindow,
xevent_mask);
}
@ -1164,6 +1214,8 @@ gdk_window_add_colormap_windows (GdkWindow *window)
toplevel = gdk_window_get_toplevel (window);
toplevel_private = (GdkWindowPrivate*) toplevel;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (!XGetWMColormapWindows (toplevel_private->xdisplay,
toplevel_private->xwindow,
@ -1211,6 +1263,8 @@ gdk_window_shape_combine_mask (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
pixmap_private = (GdkWindowPrivate*) mask;
if (window_private->destroyed)
return;
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
@ -1228,6 +1282,8 @@ gdk_dnd_drag_addwindow (GdkWindow *window)
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return;
if (window_private->dnd_drag_enabled == 1 && gdk_dnd.drag_really == 0)
{
@ -1253,6 +1309,8 @@ gdk_window_dnd_drag_set (GdkWindow *window,
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return;
window_private->dnd_drag_enabled = drag_enable ? 1 : 0;
@ -1309,8 +1367,9 @@ gdk_window_dnd_drop_set (GdkWindow *window,
int i;
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return;
window_private->dnd_drop_enabled = drop_enable ? 1 : 0;
if (drop_enable)
@ -1357,6 +1416,8 @@ gdk_window_dnd_data_set (GdkWindow *window,
window_private = (GdkWindowPrivate *) window;
g_return_if_fail (window_private->dnd_drag_accepted != 0);
if (window_private->destroyed)
return;
/* We set the property on our window... */
gdk_property_change (window, window_private->dnd_drag_data_type,
@ -1405,7 +1466,11 @@ gdk_window_add_filter (GdkWindow *window,
GList *tmp_list;
GdkEventFilter *filter;
private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
tmp_list = private->filters;
while (tmp_list)
@ -1432,7 +1497,8 @@ gdk_window_remove_filter (GdkWindow *window,
GList *tmp_list;
GdkEventFilter *filter;
private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
tmp_list = private->filters;
while (tmp_list)
@ -1455,7 +1521,14 @@ void
gdk_window_set_override_redirect(GdkWindow *window,
gboolean override_redirect)
{
GdkWindowPrivate *private;
XSetWindowAttributes attr;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
attr.override_redirect = (override_redirect == FALSE)?False:True;
XChangeWindowAttributes(gdk_display,
((GdkWindowPrivate *)window)->xwindow,

View File

@ -330,6 +330,8 @@ gdk_image_get (GdkWindow *window,
g_return_val_if_fail (window != NULL, NULL);
win_private = (GdkWindowPrivate *) window;
if (win_private->destroyed)
return NULL;
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
@ -447,6 +449,8 @@ gdk_image_put_normal (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
image_private = (GdkImagePrivate*) image;
gc_private = (GdkGCPrivate*) gc;
@ -478,6 +482,8 @@ gdk_image_put_shared (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
image_private = (GdkImagePrivate*) image;
gc_private = (GdkGCPrivate*) gc;

View File

@ -118,14 +118,20 @@ gdk_input_motion_events (GdkWindow *window,
guint32 stop,
gint *nevents_return)
{
GdkWindowPrivate *window_private;
XTimeCoord *xcoords;
GdkTimeCoord *coords;
int i;
g_return_val_if_fail (window != NULL, NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return NULL;
if (deviceid == GDK_CORE_POINTER)
{
xcoords = XGetMotionEvents (gdk_display,
((GdkWindowPrivate *)window)->xwindow,
window_private->xwindow,
start, stop, nevents_return);
if (xcoords)
{
@ -204,10 +210,14 @@ void
gdk_input_set_extension_events (GdkWindow *window, gint mask,
GdkExtensionMode mode)
{
GdkWindowPrivate *window_private;
GList *tmp_list;
GdkInputWindow *iw;
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
@ -224,7 +234,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
iw->grabbed = FALSE;
gdk_input_windows = g_list_append(gdk_input_windows,iw);
((GdkWindowPrivate *)window)->extension_events = mask;
window_private->extension_events = mask;
/* Add enter window events to the event mask */
/* FIXME, this is not needed for XINPUT_NONE */
@ -241,7 +251,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
g_free(iw);
}
((GdkWindowPrivate *)window)->extension_events = 0;
window_private->extension_events = 0;
}
for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next)

View File

@ -1248,7 +1248,7 @@ gdk_pointer_grab (GdkWindow * window,
xwindow = window_private->xwindow;
if (!confine_to)
if (!confine_to || confine_to_private->destroyed)
xconfine_to = None;
else
xconfine_to = confine_to_private->xwindow;
@ -1277,14 +1277,17 @@ gdk_pointer_grab (GdkWindow * window,
return_val = Success;;
if (return_val == Success)
return_val = XGrabPointer (window_private->xdisplay,
xwindow,
owner_events,
xevent_mask,
GrabModeAsync, GrabModeAsync,
xconfine_to,
xcursor,
time);
if (!window_private->destroyed)
return_val = XGrabPointer (window_private->xdisplay,
xwindow,
owner_events,
xevent_mask,
GrabModeAsync, GrabModeAsync,
xconfine_to,
xcursor,
time);
else
return_val = AlreadyGrabbed;
if (return_val == GrabSuccess)
xgrab_window = window_private;
@ -1371,11 +1374,14 @@ gdk_keyboard_grab (GdkWindow * window,
window_private = (GdkWindowPrivate*) window;
xwindow = window_private->xwindow;
return XGrabKeyboard (window_private->xdisplay,
xwindow,
owner_events,
GrabModeAsync, GrabModeAsync,
time);
if (!window_private->destroyed)
return XGrabKeyboard (window_private->xdisplay,
xwindow,
owner_events,
GrabModeAsync, GrabModeAsync,
time);
else
return AlreadyGrabbed;
}
/*

View File

@ -46,14 +46,16 @@ gdk_pixmap_new (GdkWindow *window,
if (!window)
window = (GdkWindow*) &gdk_root_parent;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
if (depth == -1)
gdk_window_get_geometry (window, NULL, NULL, NULL, NULL, &depth);
private = g_new (GdkWindowPrivate, 1);
pixmap = (GdkPixmap*) private;
window_private = (GdkWindowPrivate*) window;
private->xdisplay = window_private->xdisplay;
private->window_type = GDK_WINDOW_PIXMAP;
private->xwindow = XCreatePixmap (private->xdisplay, window_private->xwindow,
@ -87,11 +89,13 @@ gdk_bitmap_create_from_data (GdkWindow *window,
if (!window)
window = (GdkWindow*) &gdk_root_parent;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
private = g_new (GdkWindowPrivate, 1);
pixmap = (GdkPixmap*) private;
window_private = (GdkWindowPrivate*) window;
private->parent = NULL;
private->xdisplay = window_private->xdisplay;
private->window_type = GDK_WINDOW_PIXMAP;
@ -132,14 +136,16 @@ gdk_pixmap_create_from_data (GdkWindow *window,
if (!window)
window = (GdkWindow*) &gdk_root_parent;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
if (depth == -1)
gdk_window_get_geometry (window, NULL, NULL, NULL, NULL, &depth);
private = g_new (GdkWindowPrivate, 1);
pixmap = (GdkPixmap*) private;
window_private = (GdkWindowPrivate*) window;
private->parent = NULL;
private->xdisplay = window_private->xdisplay;
private->window_type = GDK_WINDOW_PIXMAP;

View File

@ -67,7 +67,6 @@ gdk_property_get (GdkWindow *window,
gint *actual_length,
guchar **data)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
Atom ret_prop_type;
@ -79,7 +78,12 @@ gdk_property_get (GdkWindow *window,
if (window)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return FALSE;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
@ -156,13 +160,17 @@ gdk_property_change (GdkWindow *window,
guchar *data,
gint nelements)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
if (window)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
@ -180,13 +188,17 @@ void
gdk_property_delete (GdkWindow *window,
GdkAtom property)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
if (window)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}

View File

@ -29,13 +29,17 @@ gdk_selection_owner_set (GdkWindow *owner,
guint32 time,
gint send_event)
{
GdkWindowPrivate *private;
Display *xdisplay;
Window xwindow;
if (owner)
{
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) owner;
if (private->destroyed)
return FALSE;
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
@ -73,6 +77,8 @@ gdk_selection_convert (GdkWindow *requestor,
g_return_if_fail (requestor != NULL);
private = (GdkWindowPrivate*) requestor;
if (private->destroyed)
return;
XConvertSelection (private->xdisplay, selection, target,
gdk_selection_property, private->xwindow, time);
@ -99,6 +105,8 @@ gdk_selection_property_get (GdkWindow *requestor,
moderate length, to avoid two round trips to the server */
private = (GdkWindowPrivate*) requestor;
if (private->destroyed)
return 0;
XGetWindowProperty (private->xdisplay, private->xwindow,
gdk_selection_property, 0, 0, False,

View File

@ -103,6 +103,9 @@ gdk_window_new (GdkWindow *parent,
parent = (GdkWindow*) &gdk_root_parent;
parent_private = (GdkWindowPrivate*) parent;
if (parent_private->destroyed)
return NULL;
xparent = parent_private->xwindow;
parent_display = parent_private->xdisplay;
@ -508,12 +511,15 @@ gdk_window_move (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
XMoveWindow (private->xdisplay, private->xwindow, x, y);
if (private->window_type == GDK_WINDOW_CHILD)
if (!private->destroyed)
{
private->x = x;
private->y = y;
XMoveWindow (private->xdisplay, private->xwindow, x, y);
if (private->window_type == GDK_WINDOW_CHILD)
{
private->x = x;
private->y = y;
}
}
}
@ -566,15 +572,17 @@ gdk_window_move_resize (GdkWindow *window,
height = 1;
private = (GdkWindowPrivate*) window;
XMoveResizeWindow (private->xdisplay, private->xwindow, x, y, width, height);
if (!private->destroyed &&
(private->window_type == GDK_WINDOW_CHILD))
if (!private->destroyed)
{
private->x = x;
private->y = y;
private->width = width;
private->height = height;
XMoveResizeWindow (private->xdisplay, private->xwindow, x, y, width, height);
if (private->window_type == GDK_WINDOW_CHILD)
{
private->x = x;
private->y = y;
private->width = width;
private->height = height;
}
}
}
@ -595,10 +603,11 @@ gdk_window_reparent (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
parent_private = (GdkWindowPrivate*) new_parent;
XReparentWindow (window_private->xdisplay,
window_private->xwindow,
parent_private->xwindow,
x, y);
if (!window_private->destroyed && !parent_private->destroyed)
XReparentWindow (window_private->xdisplay,
window_private->xwindow,
parent_private->xwindow,
x, y);
}
void
@ -610,7 +619,8 @@ gdk_window_clear (GdkWindow *window)
private = (GdkWindowPrivate*) window;
XClearWindow (private->xdisplay, private->xwindow);
if (!private->destroyed)
XClearWindow (private->xdisplay, private->xwindow);
}
void
@ -621,11 +631,11 @@ gdk_window_clear_area (GdkWindow *window,
gint height)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (!private->destroyed)
XClearArea (private->xdisplay, private->xwindow,
x, y, width, height, False);
@ -641,9 +651,9 @@ gdk_window_clear_area_e (GdkWindow *window,
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (!private->destroyed)
XClearArea (private->xdisplay, private->xwindow,
x, y, width, height, True);
@ -735,6 +745,9 @@ gdk_window_set_hints (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
size_hints.flags = 0;
if (flags & GDK_HINT_POS)
@ -771,8 +784,9 @@ gdk_window_set_title (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
XmbSetWMProperties (private->xdisplay, private->xwindow,
title, title, NULL, 0, NULL, NULL, NULL);
if (!private->destroyed)
XmbSetWMProperties (private->xdisplay, private->xwindow,
title, title, NULL, 0, NULL, NULL, NULL);
}
void
@ -784,7 +798,8 @@ gdk_window_set_background (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
XSetWindowBackground (private->xdisplay, private->xwindow, color->pixel);
if (!private->destroyed)
XSetWindowBackground (private->xdisplay, private->xwindow, color->pixel);
}
void
@ -809,7 +824,8 @@ gdk_window_set_back_pixmap (GdkWindow *window,
if (parent_relative)
xpixmap = ParentRelative;
XSetWindowBackgroundPixmap (window_private->xdisplay, window_private->xwindow, xpixmap);
if (!window_private->destroyed)
XSetWindowBackgroundPixmap (window_private->xdisplay, window_private->xwindow, xpixmap);
}
void
@ -830,7 +846,8 @@ gdk_window_set_cursor (GdkWindow *window,
else
xcursor = cursor_private->xcursor;
XDefineCursor (window_private->xdisplay, window_private->xwindow, xcursor);
if (!window_private->destroyed)
XDefineCursor (window_private->xdisplay, window_private->xwindow, xcursor);
}
void
@ -846,12 +863,15 @@ gdk_window_set_colormap (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
colormap_private = (GdkColormapPrivate*) colormap;
XSetWindowColormap (window_private->xdisplay,
window_private->xwindow,
colormap_private->xcolormap);
if (window_private->window_type != GDK_WINDOW_TOPLEVEL)
gdk_window_add_colormap_windows (window);
if (!window_private->destroyed)
{
XSetWindowColormap (window_private->xdisplay,
window_private->xwindow,
colormap_private->xcolormap);
if (window_private->window_type != GDK_WINDOW_TOPLEVEL)
gdk_window_add_colormap_windows (window);
}
}
void
@ -885,19 +905,22 @@ gdk_window_get_geometry (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
XGetGeometry (window_private->xdisplay, window_private->xwindow,
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
*x = tx;
if (y)
*y = ty;
if (width)
*width = twidth;
if (height)
*height = theight;
if (depth)
*depth = tdepth;
if (!window_private->destroyed)
{
XGetGeometry (window_private->xdisplay, window_private->xwindow,
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
if (x)
*x = tx;
if (y)
*y = ty;
if (width)
*width = twidth;
if (height)
*height = theight;
if (depth)
*depth = tdepth;
}
}
void
@ -947,7 +970,7 @@ gdk_window_get_visual (GdkWindow *window)
while (window_private && (window_private->window_type == GDK_WINDOW_PIXMAP))
window_private = (GdkWindowPrivate*) window_private->parent;
if (window_private)
if (window_private && !window_private->destroyed)
{
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
@ -969,11 +992,16 @@ gdk_window_get_colormap (GdkWindow *window)
window_private = (GdkWindowPrivate*) window;
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
&window_attributes);
if (!window_private->destroyed)
{
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
&window_attributes);
return gdk_colormap_lookup (window_attributes.colormap);
}
return gdk_colormap_lookup (window_attributes.colormap);
return NULL;
}
GdkWindowType
@ -1001,17 +1029,22 @@ gdk_window_get_origin (GdkWindow *window,
private = (GdkWindowPrivate*) window;
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
gdk_root_window,
0, 0, &tx, &ty,
&child);
if (x)
*x = tx;
if (y)
*y = ty;
if (!private->destroyed)
{
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
gdk_root_window,
0, 0, &tx, &ty,
&child);
if (x)
*x = tx;
if (y)
*y = ty;
}
else
return_val = 0;
return return_val;
}
@ -1035,17 +1068,18 @@ gdk_window_get_pointer (GdkWindow *window,
private = (GdkWindowPrivate*) window;
return_val = NULL;
if (XQueryPointer (private->xdisplay, private->xwindow, &root, &child,
if (!private->destroyed &&
XQueryPointer (private->xdisplay, private->xwindow, &root, &child,
&rootx, &rooty, &winx, &winy, &xmask))
{
if (x) *x = winx;
if (y) *y = winy;
if (mask) *mask = xmask;
if (child)
return_val = gdk_window_lookup (child);
}
return return_val;
}
@ -1090,6 +1124,8 @@ gdk_window_get_children (GdkWindow *window)
g_return_val_if_fail (window != NULL, NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return NULL;
XQueryTree (private->xdisplay, private->xwindow,
&root, &parent, &xchildren, &nchildren);
@ -1114,11 +1150,18 @@ gdk_window_get_children (GdkWindow *window)
GdkEventMask
gdk_window_get_events (GdkWindow *window)
{
GdkWindowPrivate *private;
XWindowAttributes attrs;
GdkEventMask event_mask;
int i;
XGetWindowAttributes (gdk_display, ((GdkWindowPrivate *)window)->xwindow,
g_return_val_if_fail (window != NULL, 0);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return 0;
XGetWindowAttributes (gdk_display, private->xwindow,
&attrs);
event_mask = 0;
@ -1135,9 +1178,16 @@ void
gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
GdkWindowPrivate *private;
long xevent_mask;
int i;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xevent_mask = StructureNotifyMask;
for (i = 0; i < nevent_masks; i++)
{
@ -1145,7 +1195,7 @@ gdk_window_set_events (GdkWindow *window,
xevent_mask |= event_mask_table[i];
}
XSelectInput (gdk_display, ((GdkWindowPrivate *)window)->xwindow,
XSelectInput (gdk_display, private->xwindow,
xevent_mask);
}
@ -1164,6 +1214,8 @@ gdk_window_add_colormap_windows (GdkWindow *window)
toplevel = gdk_window_get_toplevel (window);
toplevel_private = (GdkWindowPrivate*) toplevel;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (!XGetWMColormapWindows (toplevel_private->xdisplay,
toplevel_private->xwindow,
@ -1211,6 +1263,8 @@ gdk_window_shape_combine_mask (GdkWindow *window,
window_private = (GdkWindowPrivate*) window;
pixmap_private = (GdkWindowPrivate*) mask;
if (window_private->destroyed)
return;
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
@ -1228,6 +1282,8 @@ gdk_dnd_drag_addwindow (GdkWindow *window)
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return;
if (window_private->dnd_drag_enabled == 1 && gdk_dnd.drag_really == 0)
{
@ -1253,6 +1309,8 @@ gdk_window_dnd_drag_set (GdkWindow *window,
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return;
window_private->dnd_drag_enabled = drag_enable ? 1 : 0;
@ -1309,8 +1367,9 @@ gdk_window_dnd_drop_set (GdkWindow *window,
int i;
g_return_if_fail (window != NULL);
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return;
window_private->dnd_drop_enabled = drop_enable ? 1 : 0;
if (drop_enable)
@ -1357,6 +1416,8 @@ gdk_window_dnd_data_set (GdkWindow *window,
window_private = (GdkWindowPrivate *) window;
g_return_if_fail (window_private->dnd_drag_accepted != 0);
if (window_private->destroyed)
return;
/* We set the property on our window... */
gdk_property_change (window, window_private->dnd_drag_data_type,
@ -1405,7 +1466,11 @@ gdk_window_add_filter (GdkWindow *window,
GList *tmp_list;
GdkEventFilter *filter;
private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
tmp_list = private->filters;
while (tmp_list)
@ -1432,7 +1497,8 @@ gdk_window_remove_filter (GdkWindow *window,
GList *tmp_list;
GdkEventFilter *filter;
private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
tmp_list = private->filters;
while (tmp_list)
@ -1455,7 +1521,14 @@ void
gdk_window_set_override_redirect(GdkWindow *window,
gboolean override_redirect)
{
GdkWindowPrivate *private;
XSetWindowAttributes attr;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
attr.override_redirect = (override_redirect == FALSE)?False:True;
XChangeWindowAttributes(gdk_display,
((GdkWindowPrivate *)window)->xwindow,