summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--ChangeLog.pre-2-1012
-rw-r--r--gdk/x11/gdkcursor-x11.c4
-rw-r--r--gdk/x11/gdkfont-x11.c4
-rw-r--r--gdk/x11/gdkprivate-x11.h2
-rw-r--r--gdk/x11/gdkxid.c2
6 files changed, 34 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7eb94215c..86bb68566 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-01-19 Matthias Clasen <mclasen@redhat.com>
+
+ * gdk/x11/gdkprivate-x11.h (XID_FONT_BIT):
+ * gdk/x11/gdkfont-x11.c:
+ * gdk/x11/gdkxid.c: Use an unused high bit in the
+ XID to mark fonts in the global xid hash table.
+
+ * gdk/x11/gdkcursor-x11.c (update_cursor): Skip fonts
+ when iterating over the xid hash table, since calling
+ GDK_IS_WINDOW () on an GdkFont can cause a segfault.
+ (#327751, Ryan Lortie)
+
2006-01-18 Matthias Clasen <mclasen@redhat.com>
* configure.in: Remove "ang" again. Please add
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 7eb94215c..86bb68566 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,15 @@
+2006-01-19 Matthias Clasen <mclasen@redhat.com>
+
+ * gdk/x11/gdkprivate-x11.h (XID_FONT_BIT):
+ * gdk/x11/gdkfont-x11.c:
+ * gdk/x11/gdkxid.c: Use an unused high bit in the
+ XID to mark fonts in the global xid hash table.
+
+ * gdk/x11/gdkcursor-x11.c (update_cursor): Skip fonts
+ when iterating over the xid hash table, since calling
+ GDK_IS_WINDOW () on an GdkFont can cause a segfault.
+ (#327751, Ryan Lortie)
+
2006-01-18 Matthias Clasen <mclasen@redhat.com>
* configure.in: Remove "ang" again. Please add
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index fb4f53b14..f5e8d15ea 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -430,8 +430,12 @@ update_cursor (gpointer key,
gpointer value,
gpointer data)
{
+ XID *xid = key;
GdkCursor *cursor;
+ if (*xid & XID_FONT_BIT)
+ return;
+
if (!GDK_IS_WINDOW (value))
return;
diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c
index d4c67b401..4833283ab 100644
--- a/gdk/x11/gdkfont-x11.c
+++ b/gdk/x11/gdkfont-x11.c
@@ -50,6 +50,7 @@ struct _GdkFontPrivateX
GdkDisplay *display;
GSList *names;
+ XID xid;
};
static GHashTable *
@@ -214,13 +215,14 @@ gdk_font_load_for_display (GdkDisplay *display,
private->xfont = xfont;
private->base.ref_count = 1;
private->names = NULL;
+ private->xid = xfont->fid | XID_FONT_BIT;
font = (GdkFont*) private;
font->type = GDK_FONT_FONT;
font->ascent = xfont->ascent;
font->descent = xfont->descent;
- _gdk_xid_table_insert (display, &xfont->fid, font);
+ _gdk_xid_table_insert (display, &private->xid, font);
}
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 5e9e2cba6..fb705c1da 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -86,6 +86,8 @@ struct _GdkVisualPrivate
GdkScreen *screen;
};
+#define XID_FONT_BIT (1<<31)
+
void _gdk_xid_table_insert (GdkDisplay *display,
XID *xid,
gpointer data);
diff --git a/gdk/x11/gdkxid.c b/gdk/x11/gdkxid.c
index b192f8c8b..2c147daf2 100644
--- a/gdk/x11/gdkxid.c
+++ b/gdk/x11/gdkxid.c
@@ -123,7 +123,7 @@ static gboolean
gdk_xid_equal (XID *a,
XID *b)
{
- return (*a == *b);
+ return ((*a & ~XID_FONT_BIT) == (*b & ~XID_FONT_BIT));
}
#define __GDK_XID_C__