fix: set keyboard focus on touch target (similar to tablet/pointer)
This commit is contained in:
parent
467d1fbc7f
commit
ed7814e51e
1 changed files with 7 additions and 0 deletions
|
|
@ -1471,11 +1471,18 @@ impl State {
|
||||||
};
|
};
|
||||||
let under = State::surface_under(position, &output, &shell)
|
let under = State::surface_under(position, &output, &shell)
|
||||||
.map(|(target, pos)| (target, pos.as_logical()));
|
.map(|(target, pos)| (target, pos.as_logical()));
|
||||||
|
let focus_target = State::element_under(position, &output, &shell, &seat);
|
||||||
|
|
||||||
std::mem::drop(shell);
|
std::mem::drop(shell);
|
||||||
|
|
||||||
let serial = SERIAL_COUNTER.next_serial();
|
let serial = SERIAL_COUNTER.next_serial();
|
||||||
let touch = seat.get_touch().unwrap();
|
let touch = seat.get_touch().unwrap();
|
||||||
|
// change the keyboard focus unless the touch is grabbed, like pointer buttons
|
||||||
|
if !touch.is_grabbed()
|
||||||
|
&& let Some(target) = focus_target.as_ref()
|
||||||
|
{
|
||||||
|
Shell::set_focus(self, Some(target), &seat, Some(serial), false);
|
||||||
|
}
|
||||||
touch.down(
|
touch.down(
|
||||||
self,
|
self,
|
||||||
under,
|
under,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue