aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 8ac741bb..b42a71a2 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -23,6 +23,16 @@
#include "rootston/view.h"
#include "rootston/xcursor.h"
+
+struct roots_view *view_create() {
+ struct roots_view *view = calloc(1, sizeof(struct roots_view));
+ if (!view) {
+ return NULL;
+ }
+ view->alpha = 1.0f;
+ return view;
+}
+
void view_get_box(const struct roots_view *view, struct wlr_box *box) {
box->x = view->x;
box->y = view->y;
@@ -269,6 +279,15 @@ void view_rotate(struct roots_view *view, float rotation) {
view_damage_whole(view);
}
+void view_cycle_alpha(struct roots_view *view) {
+ view->alpha -= 0.05;
+ /* Don't go completely transparent */
+ if (view->alpha < 0.1) {
+ view->alpha = 1.0;
+ }
+ view_damage_whole(view);
+}
+
void view_close(struct roots_view *view) {
if (view->close) {
view->close(view);