Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platforms/atspi-common/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl Adapter {
action_handler: Arc<dyn ActionHandlerNoMut + Send + Sync>,
) -> Self {
let tree = Tree::new(initial_state, is_window_focused);
let focus_id = tree.state().focus_id();
let focus_id = tree.state().focus().map(|node| node.id());
let context = Context::new(app_context, tree, action_handler, root_window_bounds);
context.write_app_context().push_adapter(id, &context);
let adapter = Self {
Expand Down
9 changes: 3 additions & 6 deletions platforms/macos/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ impl Adapter {
Rc::clone(action_handler),
placeholder_context.mtm,
);
let result = context
.tree
.borrow()
.state()
.focus_id()
.map(|id| QueuedEvents::new(Rc::clone(&context), vec![focus_event(id)]));
let result = context.tree.borrow().state().focus().map(|node| {
QueuedEvents::new(Rc::clone(&context), vec![focus_event(node.id())])
});
self.state = State::Active(context);
result
}
Expand Down
4 changes: 2 additions & 2 deletions platforms/windows/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ impl Adapter {
let result = context
.read_tree()
.state()
.focus_id()
.map(|id| QueuedEvents(vec![focus_event(context, id)]));
.focus()
.map(|node| QueuedEvents(vec![focus_event(context, node.id())]));
self.state = State::Active(Arc::clone(context));
result
}
Expand Down
6 changes: 3 additions & 3 deletions platforms/windows/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,14 +1094,14 @@ impl IRawElementProviderFragmentRoot_Impl for PlatformNode_Impl {

fn GetFocus(&self) -> Result<IRawElementProviderFragment> {
self.with_tree_state(|state| {
if let Some(id) = state.focus_id() {
if let Some(node) = state.focus() {
let self_id = if let Some(id) = self.node_id {
id
} else {
state.root_id()
};
if id != self_id {
return Ok(self.relative(id).into());
if node.id() != self_id {
return Ok(self.relative(node.id()).into());
}
}
Err(Error::empty())
Expand Down