2024-03-23 19:33:17 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
#ifndef LABWC_OVERLAY_H
|
|
|
|
|
#define LABWC_OVERLAY_H
|
|
|
|
|
|
|
|
|
|
#include <wlr/util/box.h>
|
|
|
|
|
#include "common/graphic-helpers.h"
|
2024-03-24 11:46:34 +09:00
|
|
|
#include "regions.h"
|
|
|
|
|
#include "view.h"
|
2024-03-23 19:33:17 +09:00
|
|
|
|
|
|
|
|
struct overlay {
|
|
|
|
|
struct wlr_scene_tree *tree;
|
|
|
|
|
union {
|
|
|
|
|
struct wlr_scene_rect *rect;
|
|
|
|
|
struct multi_rect *pixman_rect;
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-24 11:46:34 +09:00
|
|
|
/* For caching previously shown overlay */
|
|
|
|
|
struct {
|
|
|
|
|
struct region *region;
|
|
|
|
|
enum view_edge edge;
|
|
|
|
|
} active;
|
|
|
|
|
|
|
|
|
|
/* For delayed snap-to-edge overlay */
|
2024-03-23 19:33:17 +09:00
|
|
|
struct wl_event_source *timer;
|
2024-03-24 11:46:34 +09:00
|
|
|
struct {
|
|
|
|
|
struct view *view;
|
|
|
|
|
struct wlr_box box;
|
|
|
|
|
} pending;
|
2024-03-23 19:33:17 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Calls overlay_hide() internally if the view is not to be snapped */
|
|
|
|
|
void overlay_show(struct seat *seat, struct view *view);
|
2024-03-24 11:46:34 +09:00
|
|
|
/* This function must be called when grabbed view is destroyed */
|
2024-03-23 19:33:17 +09:00
|
|
|
void overlay_hide(struct seat *seat);
|
|
|
|
|
|
|
|
|
|
#endif
|