From 46b0889d13ce0449b1add97e69aeddf0636838ae Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 26 Apr 2022 23:19:57 +0200 Subject: [PATCH] [Linux] add missing ATK_STATE_SENSITIVE flag (#32487) Fixes: flutter/flutter#101500 --- shell/platform/linux/fl_accessible_node.cc | 1 + shell/platform/linux/fl_accessible_node_test.cc | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/platform/linux/fl_accessible_node.cc b/shell/platform/linux/fl_accessible_node.cc index b797cca63a408..ffa9c249abe97 100644 --- a/shell/platform/linux/fl_accessible_node.cc +++ b/shell/platform/linux/fl_accessible_node.cc @@ -22,6 +22,7 @@ static struct { FALSE}, {ATK_STATE_SELECTED, kFlutterSemanticsFlagIsSelected, FALSE}, {ATK_STATE_ENABLED, kFlutterSemanticsFlagIsEnabled, FALSE}, + {ATK_STATE_SENSITIVE, kFlutterSemanticsFlagIsEnabled, FALSE}, {ATK_STATE_READ_ONLY, kFlutterSemanticsFlagIsReadOnly, FALSE}, {ATK_STATE_INVALID, static_cast(0), FALSE}, }; diff --git a/shell/platform/linux/fl_accessible_node_test.cc b/shell/platform/linux/fl_accessible_node_test.cc index f589c75183e62..74817de117e9f 100644 --- a/shell/platform/linux/fl_accessible_node_test.cc +++ b/shell/platform/linux/fl_accessible_node_test.cc @@ -72,10 +72,13 @@ TEST(FlAccessibleNodeTest, SetFlags) { g_autoptr(FlAccessibleNode) node = fl_accessible_node_new(engine, 0); fl_accessible_node_set_flags( - node, static_cast(kFlutterSemanticsFlagIsFocusable | + node, static_cast(kFlutterSemanticsFlagIsEnabled | + kFlutterSemanticsFlagIsFocusable | kFlutterSemanticsFlagIsFocused)); AtkStateSet* state = atk_object_ref_state_set(ATK_OBJECT(node)); + EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_ENABLED)); + EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_SENSITIVE)); EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_FOCUSABLE)); EXPECT_TRUE(atk_state_set_contains_state(state, ATK_STATE_FOCUSED)); EXPECT_TRUE(!atk_state_set_contains_state(state, ATK_STATE_CHECKED));