diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-08-30 13:16:39 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-08-30 13:16:39 +0000 |
commit | 5210bf17c62537212857cbcf96d26e84dd4d8666 (patch) | |
tree | fa4bf5ebfda4efc57679f7abfbec04d597b6f3be /gtk | |
parent | 729aaa06e9a2fd19f87bba06746e346f0d5da5d8 (diff) | |
download | gtk+-5210bf17c62537212857cbcf96d26e84dd4d8666.tar.gz |
Make it compile.
2004-08-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (gtk_text_view_delete_surrounding_handler): Make it compile.
2004-08-27 Matthias Clasen <mclasen@redhat.com>
Fix #151112, Olexiy Avramchenko:
* gtk/gtktreeview.c (gtk_tree_view_search_entry_flush_timeout):
* gtk/gtkiconview.c (scroll_timeout, layout_callback)
(gtk_icon_view_item_accessible_idle_do_action):
* gtk/gtkcombobox.c (list_popup_resize_idle, popdown_idle)
(popup_idle): Protect idle callbacks and timeouts with
GDK_THREADS_ENTER/_LEAVE.
* gtk/gtkfilechooserbutton.c (update_dialog_idle): New function to
call update_dialog() from an idle with the necessary protection.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcombobox.c | 24 | ||||
-rw-r--r-- | gtk/gtkfilechooserbutton.c | 16 | ||||
-rw-r--r-- | gtk/gtkiconview.c | 25 | ||||
-rw-r--r-- | gtk/gtktextview.c | 3 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 5 |
5 files changed, 61 insertions, 12 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 0636b94883..a5fb88f4fb 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -2706,9 +2706,13 @@ gtk_combo_box_model_row_changed (GtkTreeModel *model, static gboolean list_popup_resize_idle (gpointer user_data) { - GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); + GtkComboBox *combo_box; gint x, y, width, height; + GDK_THREADS_ENTER (); + + combo_box = GTK_COMBO_BOX (user_data); + if (combo_box->priv->tree_view && GTK_WIDGET_MAPPED (combo_box->priv->popup_window)) { @@ -2718,6 +2722,8 @@ list_popup_resize_idle (gpointer user_data) gtk_window_move (GTK_WINDOW (combo_box->priv->popup_window), x, y); } + GDK_THREADS_LEAVE (); + return FALSE; } @@ -4718,13 +4724,19 @@ gtk_cell_editable_key_press (GtkWidget *widget, static gboolean popdown_idle (gpointer data) { - GtkComboBox *combo_box = GTK_COMBO_BOX (data); + GtkComboBox *combo_box; + + GDK_THREADS_ENTER (); + + combo_box = GTK_COMBO_BOX (data); gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box)); g_object_unref (combo_box); + GDK_THREADS_LEAVE (); + return FALSE; } @@ -4738,7 +4750,11 @@ popdown_handler (GtkWidget *widget, static gboolean popup_idle (gpointer data) { - GtkComboBox *combo_box = GTK_COMBO_BOX (data); + GtkComboBox *combo_box; + + GDK_THREADS_ENTER (); + + combo_box = GTK_COMBO_BOX (data); if (GTK_IS_MENU (combo_box->priv->popup_widget) && combo_box->priv->cell_view) @@ -4750,6 +4766,8 @@ popup_idle (gpointer data) combo_box->priv->editing_canceled = TRUE; gtk_combo_box_popup (combo_box); + GDK_THREADS_LEAVE (); + return FALSE; } diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index dd7baeda01..a819a8d940 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -172,6 +172,7 @@ static void gtk_file_chooser_button_set_dialog (GObject *ob GtkWidget *dialog); static gboolean update_dialog (gpointer user_data); +static gboolean update_dialog_idle (gpointer user_data); static void update_entry (GtkFileChooserButton *button); @@ -949,6 +950,19 @@ update_dialog (gpointer user_data) return FALSE; } +static gboolean +update_dialog_idle (gpointer user_data) +{ + gboolean result; + + GDK_THREADS_ENTER (); + result = update_dialog (user_data); + GDK_THREADS_LEAVE (); + + return result; + +} + /* ************************ * * Child-Widget Callbacks * * ************************ */ @@ -1117,5 +1131,5 @@ entry_changed_cb (GtkEditable *chooser_entry, /* We do this in an idle handler to avoid totally screwing up chooser_entry's * completion */ if (priv->update_id != 0) - priv->update_id = g_idle_add (update_dialog, user_data); + priv->update_id = g_idle_add (update_dialog_idle, user_data); } diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 66b1f831c4..69380d44b5 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -872,6 +872,8 @@ scroll_timeout (gpointer data) { GtkIconView *icon_view; gdouble value; + + GDK_THREADS_ENTER (); icon_view = data; @@ -885,6 +887,8 @@ scroll_timeout (gpointer data) gtk_icon_view_update_rubberband (icon_view); + GDK_THREADS_LEAVE (); + return TRUE; } @@ -1936,12 +1940,16 @@ layout_callback (gpointer user_data) { GtkIconView *icon_view; + GDK_THREADS_ENTER (); + icon_view = GTK_ICON_VIEW (user_data); icon_view->priv->layout_idle_id = 0; gtk_icon_view_layout (icon_view); + GDK_THREADS_LEAVE(); + return FALSE; } @@ -3530,17 +3538,20 @@ gtk_icon_view_item_accessible_idle_do_action (gpointer data) GtkIconView *icon_view; GtkTreePath *path; + GDK_THREADS_ENTER (); + item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (data); item->action_idle_handler = 0; - if (item->widget == NULL) - return FALSE; - - icon_view = GTK_ICON_VIEW (item->widget); + if (item->widget != NULL) + { + icon_view = GTK_ICON_VIEW (item->widget); + path = gtk_tree_path_new_from_indices (item->item->index, -1); + gtk_icon_view_item_activated (icon_view, path); + gtk_tree_path_free (path); + } - path = gtk_tree_path_new_from_indices (item->item->index, -1); - gtk_icon_view_item_activated (icon_view, path); - gtk_tree_path_free (path); + GDK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index a350f87781..a02e0afb78 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -6678,7 +6678,8 @@ gtk_text_view_delete_surrounding_handler (GtkIMContext *context, gtk_text_iter_forward_chars (&start, offset); gtk_text_iter_forward_chars (&end, offset + n_chars); - gtk_text_buffer_delete_interactive (text_view->buffer, &start, &end); + gtk_text_buffer_delete_interactive (text_view->buffer, &start, &end, + text_view->editable); return TRUE; } diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index e4c81feeb9..3746ad5632 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -8815,8 +8815,13 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view) static gboolean gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view) { + GDK_THREADS_ENTER (); + gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view); tree_view->priv->typeselect_flush_timeout = 0; + + GDK_THREADS_LEAVE (); + return TRUE; } |