view: avoid raising same view over and over

Since view_move_to_front() now does more work than it used to
(updating XWayland server stacking order), try to avoid doing that
work unnecessarily.
This commit is contained in:
John Lindgren 2023-10-21 11:28:00 -04:00 committed by Johan Malm
parent 0ddf3c43ad
commit db591d1400
3 changed files with 31 additions and 4 deletions

View file

@ -55,9 +55,12 @@ view_impl_map(struct view *view)
void
view_impl_unmap(struct view *view)
{
struct seat *seat = &view->server->seat;
if (seat->seat->keyboard_state.focused_surface == view->surface) {
desktop_focus_topmost_view(view->server);
struct server *server = view->server;
if (view == server->focused_view) {
desktop_focus_topmost_view(server);
}
if (view == server->last_raised_view) {
server->last_raised_view = NULL;
}
}