diff options
| author | Drew DeVault <sir@cmpwn.com> | 2018-02-25 13:16:35 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-25 13:16:35 -0500 | 
| commit | 3296365ce591ae4ba115befa8134bc2526b36710 (patch) | |
| tree | e1b7a73b6d86e69b356bc8791a0b0996fa2842ad /rootston/desktop.c | |
| parent | 7da653bbb4569d41ce1a46c97e3b10c675f73741 (diff) | |
| parent | 202a728ee9a0e7dbfbcc7e51e060a2a9a5f09847 (diff) | |
| download | wlroots-3296365ce591ae4ba115befa8134bc2526b36710.tar.xz | |
Merge pull request #659 from agx/alpha
Make wlr_render_with_matrix use alpha
Diffstat (limited to 'rootston/desktop.c')
| -rw-r--r-- | rootston/desktop.c | 19 | 
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);  | 
