[gtk/gbsneto/filechooser-column-view: 72/82] filechooser: Prevent recursion when activating items




commit fd4a2995ec63c8565bafe4796dca7af4f2164b22
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 10 19:25:45 2022 -0400

    filechooser: Prevent recursion when activating items
    
    When a list item is activated, we activate the default widget.
    Unfortunately, due to some other bug, sometimes the open button
    is not made sensitive, and then default.activate falls back
    to activating the focus widget (which is the item we are just
    coming from). Boom

 gtk/gtkfilechooserwidget.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index fefe71d1b6..b866c1687b 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6252,7 +6252,10 @@ column_view_row_activated_cb (GtkColumnView        *column_view,
   else if (self->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
            self->action == GTK_FILE_CHOOSER_ACTION_SAVE)
     {
+      /* prevent recursion */
+      g_signal_handlers_block_by_func (column_view, column_view_row_activated_cb, self);
       gtk_widget_activate_default (GTK_WIDGET (self));
+      g_signal_handlers_unblock_by_func (column_view, column_view_row_activated_cb, self);
     }
 
   g_clear_object (&info);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]