overlay: add snap-to-edge overlay (PR #1652)

...and unify region overlay and snap-to-edge overlay into overlay.c.

Snap-to-edge overlay is delayed for 500ms to prevent flickering when
the view is dragged from an output to another (demo in discussion labwc#1613).

This also fixes a bug that region overlay is not shown when a modifier
key is re-pressed.
This commit is contained in:
Hiroaki Yamamoto 2024-04-05 11:35:31 +09:00 committed by GitHub
parent 67669dcf1e
commit 5cc0757390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 361 additions and 152 deletions

View file

@ -225,16 +225,7 @@ process_cursor_move(struct server *server, uint32_t time)
resistance_move_apply(view, &dx, &dy);
view_move(view, dx, dy);
/* Region overlay */
if (!regions_should_snap(server)) {
return;
}
struct region *region = regions_from_cursor(server);
if (region) {
regions_show_overlay(view, &server->seat, region);
} else {
regions_hide_overlay(&server->seat);
}
overlay_update(&server->seat);
}
static void