2024-04-05 11:35:31 +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"
|
|
|
|
|
#include "regions.h"
|
|
|
|
|
#include "view.h"
|
|
|
|
|
|
2025-06-09 16:27:17 +09:00
|
|
|
/* TODO: replace this with single lab_scene_rect */
|
2024-04-14 02:24:36 +09:00
|
|
|
struct overlay_rect {
|
2024-04-21 02:30:31 +09:00
|
|
|
struct wlr_scene_tree *tree;
|
|
|
|
|
|
|
|
|
|
bool bg_enabled;
|
|
|
|
|
struct wlr_scene_rect *bg_rect;
|
|
|
|
|
|
|
|
|
|
bool border_enabled;
|
2025-06-09 16:27:17 +09:00
|
|
|
struct lab_scene_rect *border_rect;
|
2024-04-14 02:24:36 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct overlay {
|
|
|
|
|
struct overlay_rect region_rect, edge_rect;
|
2024-04-05 11:35:31 +09:00
|
|
|
|
|
|
|
|
/* Represents currently shown or delayed overlay */
|
|
|
|
|
struct {
|
|
|
|
|
/* Region overlay */
|
|
|
|
|
struct region *region;
|
|
|
|
|
|
|
|
|
|
/* Snap-to-edge overlay */
|
2025-08-17 16:01:50 -04:00
|
|
|
enum lab_edge edge;
|
2024-04-05 11:35:31 +09:00
|
|
|
struct output *output;
|
|
|
|
|
} active;
|
|
|
|
|
|
|
|
|
|
/* For delayed snap-to-edge overlay */
|
|
|
|
|
struct wl_event_source *timer;
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-14 02:24:36 +09:00
|
|
|
void overlay_reconfigure(struct seat *seat);
|
2025-02-11 00:39:36 +01:00
|
|
|
|
2024-04-05 11:35:31 +09:00
|
|
|
/* Calls overlay_hide() internally if there's no overlay to show */
|
|
|
|
|
void overlay_update(struct seat *seat);
|
2025-02-11 00:39:36 +01:00
|
|
|
|
2024-04-05 11:35:31 +09:00
|
|
|
/* This function must be called when server->grabbed_view is destroyed */
|
|
|
|
|
void overlay_hide(struct seat *seat);
|
|
|
|
|
|
2025-02-11 00:39:36 +01:00
|
|
|
/* This function is called to clean up the timer on exit */
|
|
|
|
|
void overlay_finish(struct seat *seat);
|
|
|
|
|
|
2024-04-05 11:35:31 +09:00
|
|
|
#endif
|