summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-13 11:38:20 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-13 15:39:24 +0200
commit020ad4df7b737fa7225b4e98e3ffd78c11de71d6 (patch)
tree746815a623b8f31878a332cae4765bf38ccbcb04
parent10109852fe7e98c0e72c328e603b957a65ef534b (diff)
atspi: set FOCUSABLE state only when widget has no focusable children
AT-SPI2 specification states that active window can have only one widget with FOCUSED state. This differs from elementary design which assumes that whole elementary widget tree branch is focused. Patch assumes that if a widget have no focusable children and can have focus it can be marked as FOCUSABLE on atspi bus.
-rw-r--r--src/lib/elm_layout.c4
-rw-r--r--src/lib/elm_widget.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 06adc9de7..5fa33e06d 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -406,7 +406,7 @@ _elm_layout_elm_widget_on_focus(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED)
406 elm_layout_signal_emit(obj, "elm,action,focus", "elm"); 406 elm_layout_signal_emit(obj, "elm,action,focus", "elm");
407 evas_object_focus_set(wd->resize_obj, EINA_TRUE); 407 evas_object_focus_set(wd->resize_obj, EINA_TRUE);
408 evas_object_smart_callback_call(obj, SIG_LAYOUT_FOCUSED, NULL); 408 evas_object_smart_callback_call(obj, SIG_LAYOUT_FOCUSED, NULL);
409 if (_elm_config->atspi_mode) 409 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
410 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE); 410 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
411 } 411 }
412 else 412 else
@@ -414,7 +414,7 @@ _elm_layout_elm_widget_on_focus(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED)
414 elm_layout_signal_emit(obj, "elm,action,unfocus", "elm"); 414 elm_layout_signal_emit(obj, "elm,action,unfocus", "elm");
415 evas_object_focus_set(wd->resize_obj, EINA_FALSE); 415 evas_object_focus_set(wd->resize_obj, EINA_FALSE);
416 evas_object_smart_callback_call(obj, SIG_LAYOUT_UNFOCUSED, NULL); 416 evas_object_smart_callback_call(obj, SIG_LAYOUT_UNFOCUSED, NULL);
417 if (_elm_config->atspi_mode) 417 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
418 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_FALSE); 418 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_FALSE);
419 } 419 }
420 420
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index d27b27df8..27221d55b 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -5469,7 +5469,7 @@ _elm_widget_on_focus(Eo *obj, Elm_Widget_Smart_Data *sd)
5469 if (!sd->resize_obj) 5469 if (!sd->resize_obj)
5470 evas_object_focus_set(obj, EINA_TRUE); 5470 evas_object_focus_set(obj, EINA_TRUE);
5471 evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL); 5471 evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL);
5472 if (_elm_config->atspi_mode) 5472 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
5473 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE); 5473 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
5474 } 5474 }
5475 else 5475 else
@@ -5477,7 +5477,7 @@ _elm_widget_on_focus(Eo *obj, Elm_Widget_Smart_Data *sd)
5477 if (!sd->resize_obj) 5477 if (!sd->resize_obj)
5478 evas_object_focus_set(obj, EINA_FALSE); 5478 evas_object_focus_set(obj, EINA_FALSE);
5479 evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL); 5479 evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL);
5480 if (_elm_config->atspi_mode) 5480 if (_elm_config->atspi_mode && !elm_widget_child_can_focus_get(obj))
5481 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_FALSE); 5481 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, EINA_FALSE);
5482 } 5482 }
5483 } 5483 }
@@ -5632,10 +5632,13 @@ _elm_widget_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Widget_Sma
5632 ((wy < y) && (wy + wh < y)) || ((wy > y+ h) && (wy + wh > y + h)))) 5632 ((wy < y) && (wy + wh < y)) || ((wy > y+ h) && (wy + wh > y + h))))
5633 STATE_TYPE_SET(states, ELM_ATSPI_STATE_SHOWING); 5633 STATE_TYPE_SET(states, ELM_ATSPI_STATE_SHOWING);
5634 } 5634 }
5635 if (elm_object_focus_get(obj)) 5635 if (!elm_widget_child_can_focus_get(obj))
5636 STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSED); 5636 {
5637 if (elm_object_focus_allow_get(obj)) 5637 if (elm_object_focus_allow_get(obj))
5638 STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSABLE); 5638 STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSABLE);
5639 if (elm_object_focus_get(obj))
5640 STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSED);
5641 }
5639 if (!elm_object_disabled_get(obj)) 5642 if (!elm_object_disabled_get(obj))
5640 { 5643 {
5641 STATE_TYPE_SET(states, ELM_ATSPI_STATE_ENABLED); 5644 STATE_TYPE_SET(states, ELM_ATSPI_STATE_ENABLED);