[fixup] cache previous state & some refactoring

This commit is contained in:
tokyo4j 2024-03-24 11:46:34 +09:00
parent 0b2d58ffc5
commit 5b1a03ae69
3 changed files with 96 additions and 66 deletions

View file

@ -4,6 +4,8 @@
#include <wlr/util/box.h>
#include "common/graphic-helpers.h"
#include "regions.h"
#include "view.h"
struct overlay {
struct wlr_scene_tree *tree;
@ -12,14 +14,23 @@ struct overlay {
struct multi_rect *pixman_rect;
};
/* For delayed overlay */
struct view *view;
struct wlr_box box;
/* For caching previously shown overlay */
struct {
struct region *region;
enum view_edge edge;
} active;
/* For delayed snap-to-edge overlay */
struct wl_event_source *timer;
struct {
struct view *view;
struct wlr_box box;
} pending;
};
/* Calls overlay_hide() internally if the view is not to be snapped */
void overlay_show(struct seat *seat, struct view *view);
/* This function must be called when grabbed view is destroyed */
void overlay_hide(struct seat *seat);
#endif