Add a is_foreign flag to the structure. Do not call XFreePixmap on pixmaps

Sun Jul  2 13:06:26 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
	flag to the structure. Do not call XFreePixmap on pixmaps created
	by gdk_pixmap_foreign_new().
This commit is contained in:
Owen Taylor 2000-07-02 17:16:54 +00:00 committed by Owen Taylor
parent 4f1ccca594
commit fe7fb8c62f
10 changed files with 58 additions and 4 deletions

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -1,3 +1,9 @@
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel

View File

@ -184,5 +184,9 @@ Incompatible Changes from GTK+-1.2 to GTK+-1.4:
#define gdk_rgb_get_cmap gdk_rgb_get_colormap
- gdk_pixmap_foreign_new() no longer calls XFreePixmap() on the
pixmap when the GdkPixmap is finalized. This change corresponds
to the behavior of gdk_window_foreign_new(), and fixes a lot
of problems with code where the pixmap wasn't supposed to be
freed. If XFreePixmap() is needed, it can be done using the
destroy-notification facilities of g_object_set_data().

View File

@ -120,8 +120,10 @@ gdk_pixmap_impl_x11_finalize (GObject *object)
{
GdkPixmapImplX11 *impl = GDK_PIXMAP_IMPL_X11 (object);
GdkPixmap *wrapper = GDK_PIXMAP (GDK_DRAWABLE_IMPL_X11 (impl)->wrapper);
if (!impl->is_foreign)
XFreePixmap (GDK_PIXMAP_XDISPLAY (wrapper), GDK_PIXMAP_XID (wrapper));
XFreePixmap (GDK_PIXMAP_XDISPLAY (wrapper), GDK_PIXMAP_XID (wrapper));
gdk_xid_table_remove (GDK_PIXMAP_XID (wrapper));
G_OBJECT_CLASS (parent_class)->finalize (object);
@ -171,10 +173,11 @@ gdk_pixmap_new (GdkWindow *window,
GDK_WINDOW_XID (window),
width, height, depth);
pix_impl->is_foreign = FALSE;
pix_impl->width = width;
pix_impl->height = height;
GDK_PIXMAP_OBJECT (pixmap)->depth = depth;
gdk_xid_table_insert (&GDK_PIXMAP_XID (pixmap), pixmap);
return pixmap;
@ -205,6 +208,7 @@ gdk_bitmap_create_from_data (GdkWindow *window,
pix_impl = GDK_PIXMAP_IMPL_X11 (GDK_PIXMAP_OBJECT (pixmap)->impl);
draw_impl->wrapper = GDK_DRAWABLE (pixmap);
pix_impl->is_foreign = FALSE;
pix_impl->width = width;
pix_impl->height = height;
GDK_PIXMAP_OBJECT (pixmap)->depth = 1;
@ -253,6 +257,7 @@ gdk_pixmap_create_from_data (GdkWindow *window,
pix_impl = GDK_PIXMAP_IMPL_X11 (GDK_PIXMAP_OBJECT (pixmap)->impl);
draw_impl->wrapper = GDK_DRAWABLE (pixmap);
pix_impl->is_foreign = FALSE;
pix_impl->width = width;
pix_impl->height = height;
GDK_PIXMAP_OBJECT (pixmap)->depth = depth;
@ -301,6 +306,7 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid)
draw_impl->xdisplay = GDK_DISPLAY ();
draw_impl->xid = xpixmap;
pix_impl->is_foreign = TRUE;
pix_impl->width = w_ret;
pix_impl->height = h_ret;
GDK_PIXMAP_OBJECT (pixmap)->depth = depth_ret;

View File

@ -53,6 +53,8 @@ struct _GdkPixmapImplX11
gint width;
gint height;
guint is_foreign : 1;
};
struct _GdkPixmapImplX11Class