/* 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 gboolean gtk_selection_incr_timeout (GtkIncrInfo *info);
+static gboolean gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
static void gtk_selection_retrieval_report (GtkRetrievalInfo *info,
GdkAtom type,
gint format,
current_retrievals = g_list_append (current_retrievals, info);
gdk_selection_convert (widget->window, selection, target, time_);
- g_timeout_add (1000, (GSourceFunc) gtk_selection_retrieval_timeout, info);
+ gdk_threads_add_timeout (1000,
+ (GSourceFunc) gtk_selection_retrieval_timeout, info);
return TRUE;
}
const guchar *data,
gint length)
{
- if (selection_data->data)
- g_free (selection_data->data);
+ g_free (selection_data->data);
selection_data->type = type;
selection_data->format = format;
{
gchar *tmp = str;
str = g_convert_with_fallback (tmp, len,
- charset, "UTF-8",
+ "UTF-8", charset,
NULL, NULL, &len, &error);
g_free (tmp);
selection_data->type == text_uri_list_atom)
{
gchar **list;
- gint i;
gint count = gdk_text_property_to_utf8_list_for_display (selection_data->display,
utf8_atom,
selection_data->format,
event->time);
g_free (mult_atoms);
g_free (info);
+ gdk_error_trap_pop ();
return TRUE;
}
gdk_error_trap_pop ();
info->conversions[i].target = ((GdkAtom *)mult_atoms)[2*i];
info->conversions[i].property = ((GdkAtom *)mult_atoms)[2*i+1];
}
+
+ g_free (mult_atoms);
}
}
else /* only a single conversion */
gdk_window_get_events (info->requestor) |
GDK_PROPERTY_CHANGE_MASK);
current_incrs = g_list_append (current_incrs, info);
- g_timeout_add (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
+ gdk_threads_add_timeout (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
}
/* If it was a MULTIPLE request, set the property to indicate which
GList *tmp_list;
gboolean retval;
- GDK_THREADS_ENTER ();
-
/* Determine if retrieval has finished by checking if it still in
list of pending retrievals */
retval = TRUE; /* timeout will happen again */
}
- GDK_THREADS_LEAVE ();
-
return retval;
}
* results:
*************************************************************/
-static gint
+static gboolean
gtk_selection_retrieval_timeout (GtkRetrievalInfo *info)
{
GList *tmp_list;
gboolean retval;
- GDK_THREADS_ENTER ();
-
/* Determine if retrieval has finished by checking if it still in
list of pending retrievals */
retval = TRUE; /* timeout will happen again */
}
- GDK_THREADS_LEAVE ();
-
return retval;
}
{
g_return_if_fail (data != NULL);
- if (data->data)
- g_free (data->data);
+ g_free (data->data);
g_free (data);
}