Add swaylock protocol, add resource destructors

This prevents sway crashing if swaybg or swaybar dies.
This commit is contained in:
Drew DeVault 2015-12-03 08:35:22 -05:00
parent 2b38f298ff
commit 71afa38890
7 changed files with 68 additions and 1 deletions

View file

@ -1,18 +1,21 @@
#ifndef _SWAY_EXTENSIONS_H
#define _SWAY_EXTENSIONS_H
#include <wayland-server-core.h>
#include <wlc/wlc-wayland.h>
#include "wayland-desktop-shell-server-protocol.h"
#include "list.h"
#include "wlc/wlc-wayland.h"
struct background_config {
wlc_handle output;
wlc_resource surface;
struct wl_resource *resource;
};
struct panel_config {
wlc_handle output;
wlc_resource surface;
struct wl_resource *resource;
};
struct desktop_shell_state {
@ -22,6 +25,12 @@ struct desktop_shell_state {
struct wlc_size panel_size;
};
struct swaylock_state {
bool active;
wlc_handle output;
wlc_resource surface;
};
extern struct desktop_shell_state desktop_shell;
void register_extensions(void);