aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-18 16:30:56 +0100
committeremersion <contact@emersion.fr>2018-01-18 16:30:56 +0100
commit96d6f34eddbd0159e347d41e5c20c74a0600e878 (patch)
tree0563a2b5e07e7a388ac29b24732cf2eb616c6006 /rootston
parent7f5a538cb73eb20fa37ff98161d45a3a383622aa (diff)
rootston: replace view_damage with view_apply_damage and view_damage_whole
Diffstat (limited to 'rootston')
-rw-r--r--rootston/desktop.c19
-rw-r--r--rootston/output.c15
-rw-r--r--rootston/wl_shell.c2
-rw-r--r--rootston/xdg_shell_v6.c2
-rw-r--r--rootston/xwayland.c6
5 files changed, 29 insertions, 15 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index b8c876cb..faaefd05 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -255,7 +255,7 @@ bool view_center(struct roots_view *view) {
}
void view_destroy(struct roots_view *view) {
- view_damage(view);
+ view_damage_whole(view);
wl_signal_emit(&view->events.destroy, view);
if (view->fullscreen_output) {
@@ -268,7 +268,7 @@ void view_destroy(struct roots_view *view) {
void view_init(struct roots_view *view, struct roots_desktop *desktop) {
view->desktop = desktop;
wl_signal_init(&view->events.destroy);
- view_damage(view);
+ view_damage_whole(view);
}
void view_setup(struct roots_view *view) {
@@ -283,18 +283,25 @@ void view_setup(struct roots_view *view) {
view_update_output(view, NULL);
}
-void view_damage(struct roots_view *view) {
+void view_apply_damage(struct roots_view *view) {
struct roots_output *output;
wl_list_for_each(output, &view->desktop->outputs, link) {
- output_damage_view(output, view);
+ output_damage_from_view(output, view);
+ }
+}
+
+void view_damage_whole(struct roots_view *view) {
+ struct roots_output *output;
+ wl_list_for_each(output, &view->desktop->outputs, link) {
+ output_damage_whole_view(output, view);
}
}
void view_update_position(struct roots_view *view, double x, double y) {
- view_damage(view);
+ view_damage_whole(view);
view->x = x;
view->y = y;
- view_damage(view);
+ view_damage_whole(view);
}
static bool view_at(struct roots_view *view, double lx, double ly,
diff --git a/rootston/output.c b/rootston/output.c
index 16a185af..846bb4e6 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -379,7 +379,7 @@ static int handle_repaint(void *data) {
return 0;
}
-static void output_damage_surface(struct roots_output *output,
+static void output_damage_whole_surface(struct roots_output *output,
struct wlr_surface *surface, double lx, double ly) {
if (!wlr_surface_has_buffer(surface)) {
return;
@@ -392,17 +392,24 @@ static void output_damage_surface(struct roots_output *output,
return;
}
- // TODO: use surface damage
+
pixman_region32_union_rect(&output->damage, &output->damage, box.x, box.y,
box.width, box.height);
}
-void output_damage_view(struct roots_output *output, struct roots_view *view) {
- output_damage_surface(output, view->wlr_surface, view->x, view->y);
+void output_damage_whole_view(struct roots_output *output,
+ struct roots_view *view) {
+ output_damage_whole_surface(output, view->wlr_surface, view->x, view->y);
// TODO: subsurfaces, popups, etc
}
+void output_damage_from_view(struct roots_output *output,
+ struct roots_view *view) {
+ // TODO: use surface damage
+ output_damage_whole_view(output, view);
+}
+
static void set_mode(struct wlr_output *output,
struct roots_output_config *oc) {
int mhz = (int)(oc->mode.refresh_rate * 1000);
diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c
index e1dea82b..25ef9a3c 100644
--- a/rootston/wl_shell.c
+++ b/rootston/wl_shell.c
@@ -103,7 +103,7 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
view->pending_move_resize.update_y = false;
}
- view_damage(view);
+ view_apply_damage(view);
}
static void handle_destroy(struct wl_listener *listener, void *data) {
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c
index 259b62a5..225886ad 100644
--- a/rootston/xdg_shell_v6.c
+++ b/rootston/xdg_shell_v6.c
@@ -219,7 +219,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
}
}
- view_damage(view);
+ view_apply_damage(view);
}
static void handle_destroy(struct wl_listener *listener, void *data) {
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index b3cf409c..856c3d70 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -220,7 +220,7 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
view->pending_move_resize.update_y = false;
}
- view_damage(view);
+ view_apply_damage(view);
}
static void handle_map_notify(struct wl_listener *listener, void *data) {
@@ -233,7 +233,7 @@ static void handle_map_notify(struct wl_listener *listener, void *data) {
view->wlr_surface = xsurface->surface;
view->x = xsurface->x;
view->y = xsurface->y;
- view_damage(view);
+ view_damage_whole(view);
roots_surface->surface_commit.notify = handle_surface_commit;
wl_signal_add(&xsurface->surface->events.commit,
@@ -246,7 +246,7 @@ static void handle_unmap_notify(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, unmap_notify);
- view_damage(roots_surface->view);
+ view_damage_whole(roots_surface->view);
roots_surface->view->wlr_surface = NULL;
wl_list_remove(&roots_surface->surface_commit.link);