* Note that active_view is synced with foreign-toplevel clients.
*/
struct view *active_view;
- /*
- * Most recently raised view. Used to avoid unnecessarily
- * raising the same view over and over.
- */
- struct view *last_raised_view;
struct ssd_hover_state *ssd_hover_state;
if (view == server->active_view) {
desktop_focus_topmost_view(server);
}
- if (view == server->last_raised_view) {
- server->last_raised_view = NULL;
- }
}
static bool
if (view->impl->move_to_front) {
view->impl->move_to_front(view);
}
- view->server->last_raised_view = view;
}
static void
if (view->impl->move_to_back) {
view->impl->move_to_back(view);
}
- if (view == view->server->last_raised_view) {
- view->server->last_raised_view = NULL;
- }
}
/*
view_move_to_front(struct view *view)
{
assert(view);
- /*
- * This function is called often, generally on every mouse
- * button press (more often for focus-follows-mouse). Avoid
- * unnecessarily raising the same view over and over, or
- * attempting to raise a root view above its own sub-view.
- */
- struct view *last = view->server->last_raised_view;
- if (view == last || (last && view == view_get_root(last))) {
- return;
- }
struct view *root = view_get_root(view);
assert(root);
server->session_lock_manager->last_active_view = NULL;
}
- if (server->last_raised_view == view) {
- server->last_raised_view = NULL;
- }
-
if (server->seat.pressed.view == view) {
seat_reset_pressed(&server->seat);
}