nitpicker: re-eval pointer on panorama change

Whenever the panorama changes, eagerly re-evaluate the validity of the
current pointer position. Otherwise, the pointer may stay at an invisible
position until the next input motion happens. During this intermediate
phase, the position featured in the hover report cannot reliably be
matched against the panorama report (as needed by the sculpt manager
to let the leitzentrale GUI follow the pointer).

Issue #5370
This commit is contained in:
Norman Feske 2025-03-19 14:45:28 +01:00
parent 38650149b6
commit 1336495858
2 changed files with 13 additions and 5 deletions

View File

@ -717,22 +717,26 @@ struct Nitpicker::Main : Focus_updater, Hover_updater,
if (size_changed) {
_view_stack.bounding_box(new_bb);
if (!_user_state.pointer().ok())
_user_state.pointer(_capture_root.any_visible_pointer_position());
_update_pointer_position();
_capture_root.screen_size_changed();
/* redraw */
_view_stack.update_all_views();
}
/* re-evaluate current pointer position */
_user_state.pointer(_user_state.pointer().convert<Pointer>(
[&] (Point p) { return p; },
[&] (Nowhere) { return _capture_root.any_visible_pointer_position(); }));
_update_pointer_position();
/* notify GUI clients about the mode-info change */
for (Gui_session *s = _session_list.first(); s; s = s->next())
s->notify_mode_change();
_report_panorama();
_update_input_connection();
update_hover();
}
/**

View File

@ -228,7 +228,11 @@ class Nitpicker::User_state
_view_stack(view_stack)
{ }
void pointer(Pointer p) { _pointer = p; }
void pointer(Pointer p)
{
p.with_result([&] (Point pos) { _try_move_pointer(pos); },
[&] (Nowhere) { _pointer = Nowhere { }; });
}
Pointer pointer() const { return _pointer; }