diff options
author | emersion <contact@emersion.fr> | 2018-01-27 10:43:17 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-27 10:43:17 +0100 |
commit | 7111dd79efb6cccf39866051a92090cfc9ea5c67 (patch) | |
tree | d3e05791ad4341cddbb038840d99b2d4cd5bdae7 /rootston/desktop.c | |
parent | a011a1cb075bed2235162f1af7e88d0ee534acad (diff) |
rootston: damage tracking for rotated views
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index b2d586f4..25930d2a 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -200,7 +200,7 @@ void view_maximize(struct roots_view *view, bool maximized) { view_move_resize(view, output_box->x, output_box->y, output_box->width, output_box->height); - view->rotation = 0; + view_rotate(view, 0); } if (view->maximized && !maximized) { @@ -208,7 +208,7 @@ void view_maximize(struct roots_view *view, bool maximized) { view_move_resize(view, view->saved.x, view->saved.y, view->saved.width, view->saved.height); - view->rotation = view->saved.rotation; + view_rotate(view, view->saved.rotation); } } @@ -249,7 +249,7 @@ void view_set_fullscreen(struct roots_view *view, bool fullscreen, wlr_output_layout_get_box(view->desktop->layout, output); view_move_resize(view, output_box->x, output_box->y, output_box->width, output_box->height); - view->rotation = 0; + view_rotate(view, 0); roots_output->fullscreen_view = view; view->fullscreen_output = roots_output; @@ -258,13 +258,23 @@ void view_set_fullscreen(struct roots_view *view, bool fullscreen, if (was_fullscreen && !fullscreen) { view_move_resize(view, view->saved.x, view->saved.y, view->saved.width, view->saved.height); - view->rotation = view->saved.rotation; + view_rotate(view, view->saved.rotation); view->fullscreen_output->fullscreen_view = NULL; view->fullscreen_output = NULL; } } +void view_rotate(struct roots_view *view, float rotation) { + if (view->rotation == rotation) { + return; + } + + view_damage_whole(view); + view->rotation = rotation; + view_damage_whole(view); +} + void view_close(struct roots_view *view) { if (view->close) { view->close(view); |