simplify construction

This commit is contained in:
yggverse 2025-10-11 23:01:21 +03:00
parent 58394f84ca
commit ffca1d3d60

View file

@ -169,14 +169,12 @@ impl Request {
// Note: // Note:
// * Custom GestureClick is not an option here, as GTK Entry has default controller // * Custom GestureClick is not an option here, as GTK Entry has default controller
// * This is experimental feature does not follow native GTK behavior @TODO make optional // * This is experimental feature does not follow native GTK behavior @TODO make optional
if !has_focus.take() if !has_focus.replace(state.contains(StateFlags::FOCUS_WITHIN))
&& state.contains(StateFlags::ACTIVE | StateFlags::FOCUS_WITHIN) && state.contains(StateFlags::ACTIVE | StateFlags::FOCUS_WITHIN)
&& this.selection_bounds().is_none() && this.selection_bounds().is_none()
{ {
this.select_region(0, -1) this.select_region(0, -1)
} }
// Update last focus state
has_focus.replace(state.contains(StateFlags::FOCUS_WITHIN));
} }
}); });