From f00ebf87818d07949885a7d8446a8ea26d2209e5 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 4 Apr 2019 17:43:24 +0200 Subject: [PATCH] Fix open dialog not showing up in accerciser etc. --- firefox-patches/patches-60/open_file | 38 ++++++++++++++++++++++++ firefox-patches/series-60 | 1 + firefox-patches/version | 2 +- thunderbird-patches/patches-60/open_file | 38 ++++++++++++++++++++++++ thunderbird-patches/series-60 | 1 + thunderbird-patches/version | 2 +- 6 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 firefox-patches/patches-60/open_file create mode 100644 thunderbird-patches/patches-60/open_file diff --git a/firefox-patches/patches-60/open_file b/firefox-patches/patches-60/open_file new file mode 100644 index 0000000..9624009 --- /dev/null +++ b/firefox-patches/patches-60/open_file @@ -0,0 +1,38 @@ +Fix open dialog not showing up in accerciser etc. + +# HG changeset patch +# User Samuel Thibault +# Date 1554391632 -7200 +# Thu Apr 04 17:27:12 2019 +0200 +# Branch open_dialog +# Node ID f71d2de023214cea39ddd18e6ea99c9136e5f8a6 +# Parent 5c4afd893ae45d3fb0f1c220632a8d7d13b75ba0 +Bug 1541457 atk: Also look for refined roles of dialog boxes + +diff --git a/accessible/atk/ApplicationAccessibleWrap.cpp b/accessible/atk/ApplicationAccessibleWrap.cpp +--- a/accessible/atk/ApplicationAccessibleWrap.cpp ++++ b/accessible/atk/ApplicationAccessibleWrap.cpp +@@ -35,20 +35,22 @@ gboolean toplevel_event_watcher(GSignalI + + if (nsAccessibilityService::IsShutdown()) return TRUE; + + GObject* object = + reinterpret_cast(g_value_get_object(param_values)); + if (!GTK_IS_WINDOW(object)) return TRUE; + + AtkObject* child = gtk_widget_get_accessible(GTK_WIDGET(object)); ++ AtkRole role = atk_object_get_role(child); + + // GTK native dialog + if (!IS_MAI_OBJECT(child) && +- (atk_object_get_role(child) == ATK_ROLE_DIALOG)) { ++ (role == ATK_ROLE_DIALOG || role == ATK_ROLE_FILE_CHOOSER || ++ role == ATK_ROLE_COLOR_CHOOSER || role == ATK_ROLE_FONT_CHOOSER)) { + if (data == reinterpret_cast(nsIAccessibleEvent::EVENT_SHOW)) { + // Attach the dialog accessible to app accessible tree + Accessible* windowAcc = GetAccService()->AddNativeRootAccessible(child); + g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj, + reinterpret_cast(windowAcc)); + + } else { + // Deattach the dialog accessible diff --git a/firefox-patches/series-60 b/firefox-patches/series-60 index 78c1951..cbb62fb 100644 --- a/firefox-patches/series-60 +++ b/firefox-patches/series-60 @@ -8,3 +8,4 @@ scrollsubstringto control-enter text-at-offset-word text-at-offset-word2 +open_file diff --git a/firefox-patches/version b/firefox-patches/version index b8626c4..7ed6ff8 100644 --- a/firefox-patches/version +++ b/firefox-patches/version @@ -1 +1 @@ -4 +5 diff --git a/thunderbird-patches/patches-60/open_file b/thunderbird-patches/patches-60/open_file new file mode 100644 index 0000000..9624009 --- /dev/null +++ b/thunderbird-patches/patches-60/open_file @@ -0,0 +1,38 @@ +Fix open dialog not showing up in accerciser etc. + +# HG changeset patch +# User Samuel Thibault +# Date 1554391632 -7200 +# Thu Apr 04 17:27:12 2019 +0200 +# Branch open_dialog +# Node ID f71d2de023214cea39ddd18e6ea99c9136e5f8a6 +# Parent 5c4afd893ae45d3fb0f1c220632a8d7d13b75ba0 +Bug 1541457 atk: Also look for refined roles of dialog boxes + +diff --git a/accessible/atk/ApplicationAccessibleWrap.cpp b/accessible/atk/ApplicationAccessibleWrap.cpp +--- a/accessible/atk/ApplicationAccessibleWrap.cpp ++++ b/accessible/atk/ApplicationAccessibleWrap.cpp +@@ -35,20 +35,22 @@ gboolean toplevel_event_watcher(GSignalI + + if (nsAccessibilityService::IsShutdown()) return TRUE; + + GObject* object = + reinterpret_cast(g_value_get_object(param_values)); + if (!GTK_IS_WINDOW(object)) return TRUE; + + AtkObject* child = gtk_widget_get_accessible(GTK_WIDGET(object)); ++ AtkRole role = atk_object_get_role(child); + + // GTK native dialog + if (!IS_MAI_OBJECT(child) && +- (atk_object_get_role(child) == ATK_ROLE_DIALOG)) { ++ (role == ATK_ROLE_DIALOG || role == ATK_ROLE_FILE_CHOOSER || ++ role == ATK_ROLE_COLOR_CHOOSER || role == ATK_ROLE_FONT_CHOOSER)) { + if (data == reinterpret_cast(nsIAccessibleEvent::EVENT_SHOW)) { + // Attach the dialog accessible to app accessible tree + Accessible* windowAcc = GetAccService()->AddNativeRootAccessible(child); + g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj, + reinterpret_cast(windowAcc)); + + } else { + // Deattach the dialog accessible diff --git a/thunderbird-patches/series-60 b/thunderbird-patches/series-60 index 61daebd..991f149 100644 --- a/thunderbird-patches/series-60 +++ b/thunderbird-patches/series-60 @@ -8,3 +8,4 @@ scrollsubstringto control-enter text-at-offset-word text-at-offset-word2 +open_file diff --git a/thunderbird-patches/version b/thunderbird-patches/version index b8626c4..7ed6ff8 100644 --- a/thunderbird-patches/version +++ b/thunderbird-patches/version @@ -1 +1 @@ -4 +5 -- GitLab