diff options
author | Dave Camp <dave@ximian.com> | 2002-08-15 16:08:36 +0000 |
---|---|---|
committer | Dave Camp <campd@src.gnome.org> | 2002-08-15 16:08:36 +0000 |
commit | 010d502704a37cdeb35b504e7f0d2a4531118bf6 (patch) | |
tree | 9f64b09d23fcf8b34e4e433067ea11da89777b0f | |
parent | a9acc6aec1a8778be1d024327af6d14bf7975112 (diff) | |
download | nautilus-010d502704a37cdeb35b504e7f0d2a4531118bf6.tar.gz |
Save the source so the idle callback can cancel the weak ref.
2002-08-15 Dave Camp <dave@ximian.com>
* libnautilus/nautilus-clipboard.c (select_all_callback): Save the
source so the idle callback can cancel the weak ref.
(select_all_idle_callback): Cancel the weak ref so the source
isn't destroyed twice.
This should fix #74403.
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | libnautilus/nautilus-clipboard.c | 35 |
2 files changed, 48 insertions, 7 deletions
@@ -1,3 +1,11 @@ +2002-08-15 Dave Camp <dave@ximian.com> + + * libnautilus/nautilus-clipboard.c (select_all_callback): Save the + source so the idle callback can cancel the weak ref. + (select_all_idle_callback): Cancel the weak ref so the source + isn't destroyed twice. + This should fix #74403. + 2002-08-15 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-icon-container.c (icon_set_position): @@ -96,6 +104,18 @@ 2002-08-09 Dave Camp <dave@ximian.com> + * libnautilus-private/nautilus-icon-canvas-item.c: + (draw_label_layout): Don't draw a drop shadow on selected text. + * libnautilus-private/nautilus-icon-container.c: (style_set): Call + setup_label_gcs(). + (setup_label_gcs): Use the text color from the gtk theme as a + fallback for the selection text color. + (nautilus_icon_container_theme_changed): Make the + highlight_color_rgba a little bit transparent when falling back to + the gtk theme. + +2002-08-09 Dave Camp <dave@ximian.com> + * libnautilus-private/nautilus-directory.c (call_files_changed_common): Don't add files to the work queue of a directory they don't belong to. diff --git a/libnautilus/nautilus-clipboard.c b/libnautilus/nautilus-clipboard.c index c16c22e93..9e595e103 100644 --- a/libnautilus/nautilus-clipboard.c +++ b/libnautilus/nautilus-clipboard.c @@ -96,26 +96,38 @@ select_all (GtkEditable *editable) gtk_editable_select_region (editable, 0, -1); } +static void +idle_source_destroy_callback (gpointer data, + GObject *where_the_object_was) +{ + g_source_destroy (data); +} + static gboolean select_all_idle_callback (gpointer callback_data) { GtkEditable *editable; + GSource *source; editable = GTK_EDITABLE (callback_data); + source = g_object_get_data (G_OBJECT (editable), + "clipboard-select-all-source"); + + g_object_weak_unref (G_OBJECT (editable), + idle_source_destroy_callback, + source); + + g_object_set_data (G_OBJECT (editable), + "clipboard-select-all-source", + NULL); + select_all (editable); return FALSE; } static void -idle_source_destroy_callback (gpointer data, - GObject *where_the_object_was) -{ - g_source_destroy (data); -} - -static void select_all_callback (BonoboUIComponent *ui, gpointer callback_data, const char *command_name) @@ -128,6 +140,11 @@ select_all_callback (BonoboUIComponent *ui, editable = GTK_EDITABLE (callback_data); + if (g_object_get_data (G_OBJECT (editable), + "clipboard-select-all-source")) { + return; + } + source = g_idle_source_new (); g_source_set_callback (source, select_all_idle_callback, editable, NULL); g_object_weak_ref (G_OBJECT (editable), @@ -135,6 +152,10 @@ select_all_callback (BonoboUIComponent *ui, source); g_source_attach (source, NULL); g_source_unref (source); + + g_object_set_data (G_OBJECT (editable), + "clipboard-select-all-source", + source); } static void |