overlay: add snap-to-edge overlay

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

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

This also fixes a bug that region overlay is not shown when a modifier
key is re-pressed.
This commit is contained in:
tokyo4j 2024-03-23 19:33:17 +09:00
parent d68376f2ac
commit 0b2d58ffc5
11 changed files with 260 additions and 150 deletions

View file

@ -25,14 +25,6 @@ struct region {
} center;
};
struct region_overlay {
struct wlr_scene_tree *tree;
union {
struct wlr_scene_rect *overlay;
struct multi_rect *pixman_overlay;
};
};
/* Returns true if we should show the region overlay or snap to region */
bool regions_should_snap(struct server *server);
@ -73,7 +65,4 @@ void regions_destroy(struct seat *seat, struct wl_list *regions);
struct region *regions_from_cursor(struct server *server);
struct region *regions_from_name(const char *region_name, struct output *output);
void regions_show_overlay(struct view *view, struct seat *seat, struct region *region);
void regions_hide_overlay(struct seat *seat);
#endif /* LABWC_REGIONS_H */