mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-11 05:34:37 -04:00
parent
c848bafaed
commit
8faf7a2f59
3 changed files with 17 additions and 1 deletions
15
output.c
15
output.c
|
|
@ -26,6 +26,15 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
render_overlay(struct wlr_renderer *renderer, struct wlr_output *output, int width, int height)
|
||||||
|
{
|
||||||
|
struct wlr_box box = { .width = width, .height = height };
|
||||||
|
float color[4] = { 0.0, 0.0, 0.0, 0.3 };
|
||||||
|
|
||||||
|
wlr_render_rect(renderer, &box, color, output->transform_matrix);
|
||||||
|
}
|
||||||
|
|
||||||
/* Used to move all of the data necessary to render a surface from the
|
/* Used to move all of the data necessary to render a surface from the
|
||||||
* top-level frame handler to the per-surface render function. */
|
* top-level frame handler to the per-surface render function. */
|
||||||
struct render_data {
|
struct render_data {
|
||||||
|
|
@ -102,6 +111,12 @@ handle_output_frame(struct wl_listener *listener, void *data)
|
||||||
wl_list_for_each_reverse(view, &output->server->views, link) {
|
wl_list_for_each_reverse(view, &output->server->views, link) {
|
||||||
rdata.view = view;
|
rdata.view = view;
|
||||||
view_for_each_surface(view, render_surface, &rdata);
|
view_for_each_surface(view, render_surface, &rdata);
|
||||||
|
/* If we have dialogs open and this view is not the
|
||||||
|
top of the stack, draw an overlay. */
|
||||||
|
if (have_dialogs_open(output->server) &&
|
||||||
|
view->link.prev != &output->server->views) {
|
||||||
|
render_overlay(renderer, output->wlr_output, width, height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_renderer_end(renderer);
|
wlr_renderer_end(renderer);
|
||||||
|
|
|
||||||
2
seat.c
2
seat.c
|
|
@ -26,7 +26,7 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
|
||||||
static inline bool
|
bool
|
||||||
have_dialogs_open(struct cg_server *server)
|
have_dialogs_open(struct cg_server *server)
|
||||||
{
|
{
|
||||||
/* We only need to test if there is more than a single
|
/* We only need to test if there is more than a single
|
||||||
|
|
|
||||||
1
seat.h
1
seat.h
|
|
@ -70,5 +70,6 @@ struct cg_seat *cg_seat_create(struct cg_server *server);
|
||||||
void cg_seat_destroy(struct cg_seat *seat);
|
void cg_seat_destroy(struct cg_seat *seat);
|
||||||
struct cg_view *seat_get_focus(struct cg_seat *seat);
|
struct cg_view *seat_get_focus(struct cg_seat *seat);
|
||||||
void seat_set_focus(struct cg_seat *seat, struct cg_view *view);
|
void seat_set_focus(struct cg_seat *seat, struct cg_view *view);
|
||||||
|
bool have_dialogs_open(struct cg_server *server);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue