feat: add lock session protocol support (WIP)

This commit is contained in:
DanyLE
2024-04-15 17:32:53 +02:00
parent fdb2843561
commit 5b29514b09
8 changed files with 339 additions and 4 deletions

View File

@ -7,6 +7,8 @@
#include "layer.h"
#include "node.h"
#include "view.h"
#include "session.h"
static void output_frame(struct wl_listener *listener, void *data)
{
/* This function is called every time an output is ready to display a frame,
@ -38,7 +40,10 @@ static void output_request_state(struct wl_listener *listener, void *data)
static void output_destroy(struct wl_listener *listener, void *data)
{
struct diyac_output *output = wl_container_of(listener, output, destroy);
if(output->lock_handle)
{
diyac_session_unlock_output(output);
}
wlr_scene_node_destroy(&output->scenes.background->node);
wlr_scene_node_destroy(&output->scenes.bottom->node);
wlr_scene_node_destroy(&output->scenes.top->node);
@ -147,6 +152,12 @@ void diyac_server_new_output(struct wl_listener *listener, void *data)
output->layer_tree[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM] = output->scenes.bottom;
output->layer_tree[ZWLR_LAYER_SHELL_V1_LAYER_TOP] = output->scenes.top;
output->layer_tree[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY] = output->scenes.overlay;
output->lock_handle = NULL;
if(server->lock)
{
diyac_session_lock_output(output);
}
/*
* Set the z-positions to achieve the following order (from top to
* bottom):