[nautilus/wip/antoniof/gtk4-pre-switch-regressions: 7/7] general: Disable a11y code




commit 311375a01f7ed7c4c64827606fd10e2ee260cd04
Author: António Fernandes <antoniof gnome org>
Date:   Thu Dec 23 00:51:10 2021 +0000

    general: Disable a11y code
    
    GTK 4 changes how acessibility is implemented compared to GTK 3.
    
    Disable this code before the switch. It shall be reimplemented
    once we are building against GTK 4.

 src/nautilus-file-operations.c   | 2 ++
 src/nautilus-files-view.c        | 4 ++++
 src/nautilus-list-view.c         | 4 ++++
 src/nautilus-properties-window.c | 4 ++++
 4 files changed, 14 insertions(+)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 72ae0d2c8..f5068b11c 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -3033,7 +3033,9 @@ prompt_empty_trash (GtkWindow *parent_window)
                             _("Empty _Trash"), GTK_RESPONSE_ACCEPT, NULL);
     gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
     gtk_window_set_title (GTK_WINDOW (dialog), "");
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     atk_object_set_role (gtk_widget_get_accessible (dialog), ATK_ROLE_ALERT);
+#endif
 
     result = gtk_dialog_run (GTK_DIALOG (dialog));
     gtk_widget_destroy (dialog);
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index a9228002b..68a542209 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -9743,7 +9743,9 @@ nautilus_files_view_init (NautilusFilesView *view)
 {
     NautilusFilesViewPrivate *priv;
     GtkBuilder *builder;
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     AtkObject *atk_object;
+#endif
     NautilusDirectory *scripts_directory;
     NautilusDirectory *templates_directory;
     gchar *templates_uri;
@@ -9976,10 +9978,12 @@ nautilus_files_view_init (NautilusFilesView *view)
 
     priv->in_destruction = FALSE;
 
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     /* Accessibility */
     atk_object = gtk_widget_get_accessible (GTK_WIDGET (view));
     atk_object_set_name (atk_object, _("Content View"));
     atk_object_set_description (atk_object, _("View of the current folder"));
+#endif
 
     priv->view_action_group = G_ACTION_GROUP (g_simple_action_group_new ());
     g_action_map_add_action_entries (G_ACTION_MAP (priv->view_action_group),
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 3ff2c953a..3413a1183 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2004,7 +2004,9 @@ create_and_set_up_tree_view (NautilusListView *view)
 {
     GtkCellRenderer *cell;
     GtkTreeViewColumn *column;
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     AtkObject *atk_obj;
+#endif
     GList *nautilus_columns;
     GList *l;
     gchar **default_column_order, **default_visible_columns;
@@ -2320,8 +2322,10 @@ create_and_set_up_tree_view (NautilusListView *view)
     gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (content_widget),
                                    GTK_WIDGET (view->details->tree_view));
 
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     atk_obj = gtk_widget_get_accessible (GTK_WIDGET (view->details->tree_view));
     atk_object_set_name (atk_obj, _("List View"));
+#endif
 
     g_strfreev (default_visible_columns);
     g_strfreev (default_column_order);
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index ac9a561bf..539bc1681 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -3164,10 +3164,12 @@ static void
 setup_execute_checkbox_with_label (NautilusPropertiesWindow *self,
                                    guint32                   permission_to_check)
 {
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     gboolean a11y_enabled;
     GtkLabel *label_for;
 
     label_for = GTK_LABEL (self->execute_label);
+#endif
     gtk_widget_show (self->execute_label);
     gtk_widget_show (self->execute_checkbox);
 
@@ -3188,6 +3190,7 @@ setup_execute_checkbox_with_label (NautilusPropertiesWindow *self,
                              self,
                              0);
 
+#if 0 && NAUTILUS_A11Y_NEEDS_GTK4_REIMPLEMENTATION
     a11y_enabled = GTK_IS_ACCESSIBLE (gtk_widget_get_accessible (self->execute_checkbox));
     if (a11y_enabled && label_for != NULL)
     {
@@ -3203,6 +3206,7 @@ setup_execute_checkbox_with_label (NautilusPropertiesWindow *self,
         /* Create the widget -> label relation */
         atk_object_add_relationship (atk_widget, ATK_RELATION_LABELLED_BY, atk_label);
     }
+#endif
 }
 
 enum


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