summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-06-11 18:06:04 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-06-11 18:06:04 +0000
commit62e51198728e9583831b36ae442a96c185bdd2e7 (patch)
treebd683ac4fe21042a91907ae5124a50a1294d9ed8
parentb166924b0ccf6d5c3b5b36d04b1d8f7df2072ef6 (diff)
downloadgdk-pixbuf-62e51198728e9583831b36ae442a96c185bdd2e7.tar.gz
Fix cut and paste typo where wrong pixmap was being unref'ed. (Pointed out
Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix cut and paste typo where wrong pixmap was being unref'ed. (Pointed out by a friend of KUSANO Takayuki.) Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_selection_bytes_per_item): Add helper function to compute format / bytes relationship. Use in a couple places to fix up errors which assume 8 * format. * gtk/gtkselection.c (gtk_selection_request): Use 32 rather than 8 * sizeof (GdkAtom), to work correctly on Alpha.
-rw-r--r--ChangeLog21
-rw-r--r--ChangeLog.pre-2-021
-rw-r--r--ChangeLog.pre-2-1021
-rw-r--r--ChangeLog.pre-2-221
-rw-r--r--ChangeLog.pre-2-421
-rw-r--r--ChangeLog.pre-2-621
-rw-r--r--ChangeLog.pre-2-821
-rw-r--r--gtk/gtkdnd.c2
-rw-r--r--gtk/gtkselection.c74
9 files changed, 164 insertions, 59 deletions
diff --git a/ChangeLog b/ChangeLog
index 73673257d..60be66d1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 73673257d..60be66d1b 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 73673257d..60be66d1b 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 73673257d..60be66d1b 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 73673257d..60be66d1b 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 73673257d..60be66d1b 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 73673257d..60be66d1b 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,13 +1,24 @@
-Thu Jun 8 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Save cflags for all backends, not just X11.
+Sun Jun 11 12:46:19 2000 Owen Taylor <otaylor@redhat.com>
-Wed Jun 7 15:44:42 2000 Elliot Lee <sopwith@redhat.com>
- * configure.in: Use $PANGO_CONFIG instead of pango-config
+ * gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
+ cut and paste typo where wrong pixmap was being
+ unref'ed. (Pointed out by a friend of KUSANO Takayuki.)
+
+Sun Jun 11 10:22:36 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkselection.c (gtk_selection_bytes_per_item):
+ Add helper function to compute format / bytes
+ relationship. Use in a couple places to fix up
+ errors which assume 8 * format.
+
+ * gtk/gtkselection.c (gtk_selection_request): Use 32
+ rather than 8 * sizeof (GdkAtom), to work correctly
+ on Alpha.
Wed Jun 7 15:44:42 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDFLAGS): Add missing backslash that was keeping
- GTK+ from even building at all
+ GTK+ from building at all.
* gdk/Makefile.am (gdk_c_sources): Fix up some indentation issues.
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 74e40352e..e00fa7d59 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -2065,7 +2065,7 @@ gtk_drag_set_default_icon (GdkColormap *colormap,
if (default_icon_pixmap)
gdk_pixmap_unref (default_icon_pixmap);
if (default_icon_mask)
- gdk_pixmap_unref (default_icon_pixmap);
+ gdk_pixmap_unref (default_icon_mask);
default_icon_colormap = colormap;
gdk_colormap_ref (colormap);
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index 2bfbf95ed..c443282e9 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -139,18 +139,21 @@ struct _GtkRetrievalInfo
};
/* Local Functions */
-static void gtk_selection_init (void);
-static gint gtk_selection_incr_timeout (GtkIncrInfo *info);
-static gint gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
-static void gtk_selection_retrieval_report (GtkRetrievalInfo *info,
- GdkAtom type, gint format,
- guchar *buffer, gint length,
- guint32 time);
-static void gtk_selection_invoke_handler (GtkWidget *widget,
- GtkSelectionData *data,
- guint time);
-static void gtk_selection_default_handler (GtkWidget *widget,
- GtkSelectionData *data);
+static void gtk_selection_init (void);
+static gint gtk_selection_incr_timeout (GtkIncrInfo *info);
+static gint gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
+static void gtk_selection_retrieval_report (GtkRetrievalInfo *info,
+ GdkAtom type,
+ gint format,
+ guchar *buffer,
+ gint length,
+ guint32 time);
+static void gtk_selection_invoke_handler (GtkWidget *widget,
+ GtkSelectionData *data,
+ guint time);
+static void gtk_selection_default_handler (GtkWidget *widget,
+ GtkSelectionData *data);
+static int gtk_selection_bytes_per_item (gint format);
/* Local Data */
static gint initialize = TRUE;
@@ -891,7 +894,7 @@ gtk_selection_request (GtkWidget *widget,
for (i=0; i<info->num_conversions; i++)
{
GtkSelectionData data;
- gint items;
+ glong items;
data.selection = event->selection;
data.target = info->conversions[i].target;
@@ -916,7 +919,7 @@ gtk_selection_request (GtkWidget *widget,
g_return_val_if_fail ((data.format >= 8) && (data.format % 8 == 0), FALSE);
- items = (data.length + data.format/8 - 1) / (data.format/8);
+ items = data.length / gtk_selection_bytes_per_item (data.format);
if (data.length > GTK_SELECTION_MAX_SIZE)
{
@@ -929,7 +932,7 @@ gtk_selection_request (GtkWidget *widget,
gdk_property_change (info->requestor,
info->conversions[i].property,
gtk_selection_atoms[INCR],
- 8*sizeof (GdkAtom),
+ 32,
GDK_PROP_MODE_REPLACE,
(guchar *)&items, 1);
}
@@ -972,7 +975,7 @@ gtk_selection_request (GtkWidget *widget,
if (event->target == gtk_selection_atoms[MULTIPLE])
{
gdk_property_change (info->requestor, event->property,
- GDK_SELECTION_TYPE_ATOM, 8*sizeof(GdkAtom),
+ GDK_SELECTION_TYPE_ATOM, 32,
GDK_PROP_MODE_REPLACE,
mult_atoms, 2*info->num_conversions);
g_free (mult_atoms);
@@ -1053,6 +1056,8 @@ gtk_selection_incr_event (GdkWindow *window,
if (info->conversions[i].property == event->atom &&
info->conversions[i].offset != -1)
{
+ int bytes_per_item;
+
info->idle_time = 0;
if (info->conversions[i].offset == -2) /* only the last 0-length
@@ -1081,13 +1086,14 @@ gtk_selection_incr_event (GdkWindow *window,
num_bytes, info->conversions[i].offset,
GDK_WINDOW_XWINDOW(info->requestor), event->atom);
#endif
+
+ bytes_per_item = gtk_selection_bytes_per_item (info->conversions[i].data.format);
gdk_property_change (info->requestor, event->atom,
info->conversions[i].data.type,
info->conversions[i].data.format,
GDK_PROP_MODE_REPLACE,
- buffer,
- (num_bytes + info->conversions[i].data.format/8 - 1) /
- (info->conversions[i].data.format/8));
+ buffer,
+ num_bytes / bytes_per_item);
if (info->conversions[i].offset == -2)
{
@@ -1517,11 +1523,13 @@ gtk_selection_default_handler (GtkWidget *widget,
if ((selection_info->widget == widget) &&
(selection_info->selection == data->selection))
{
+ gulong time = selection_info->time;
+
gtk_selection_data_set (data,
GDK_SELECTION_TYPE_INTEGER,
- sizeof (guint32)*8,
- (guchar *)&selection_info->time,
- sizeof (guint32));
+ 32,
+ (guchar *)&time,
+ sizeof (time));
return;
}
@@ -1544,7 +1552,7 @@ gtk_selection_default_handler (GtkWidget *widget,
count = g_list_length (target_list->list) + 3;
data->type = GDK_SELECTION_TYPE_ATOM;
- data->format = 8*sizeof (GdkAtom);
+ data->format = 32;
data->length = count * sizeof (GdkAtom);
p = g_new (GdkAtom, count);
@@ -1590,3 +1598,23 @@ gtk_selection_data_free (GtkSelectionData *data)
g_free (data);
}
+
+static int
+gtk_selection_bytes_per_item (gint format)
+{
+ switch (format)
+ {
+ case 8:
+ return sizeof (char);
+ break;
+ case 16:
+ return sizeof (short);
+ break;
+ case 32:
+ return sizeof (long);
+ break;
+ default:
+ g_assert_not_reached();
+ }
+ return 0;
+}