summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2012-09-14 13:12:04 (GMT)
committerKristian Høgsberg <krh@bitplanet.net>2012-09-14 17:43:08 (GMT)
commit231ba171c6af2e379c45e4ae997cb56573f87375 (patch)
treeff5136b8f146122fed61cfd0369045f8c0bdcea6
parent8ea818fb00aa45fb6e9ff83059778502cef82d1b (diff)
compositor: Always assign an output when updating a surface transform
Also make all the callers of weston_surface_assign_output() update the transform instead. This makes sure that when the surface is assigned an output its bouding box is valid. This fixes a bug where a newly created surface would have a NULL output assigned. This would cause weston_surface_schedule_repaint() to not schedule a repaint, preventing the surface to be shown until something else caused a repaint.
-rw-r--r--src/compositor.c9
-rw-r--r--src/shell.c11
-rw-r--r--src/tablet-shell.c2
-rw-r--r--tests/event-test.c2
-rw-r--r--tests/text-test.c2
5 files changed, 12 insertions, 14 deletions
diff --git a/src/compositor.c b/src/compositor.c
index bda1381..8c8dff0 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -456,8 +456,7 @@ weston_surface_update_transform(struct weston_surface *surface)
weston_surface_damage_below(surface);
- if (weston_surface_is_mapped(surface))
- weston_surface_assign_output(surface);
+ weston_surface_assign_output(surface);
}
WL_EXPORT void
@@ -1026,7 +1025,7 @@ weston_compositor_fade(struct weston_compositor *compositor, float tint)
weston_surface_set_color(surface, 0.0, 0.0, 0.0, 0.0);
wl_list_insert(&compositor->fade_layer.surface_list,
&surface->layer_link);
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
compositor->fade.surface = surface;
pixman_region32_init(&surface->input);
}
@@ -1929,7 +1928,7 @@ pointer_cursor_surface_configure(struct weston_surface *es,
if (!weston_surface_is_mapped(es)) {
wl_list_insert(&es->compositor->cursor_layer.surface_list,
&es->layer_link);
- weston_surface_assign_output(es);
+ weston_surface_update_transform(es);
}
}
@@ -2416,7 +2415,7 @@ device_map_drag_surface(struct weston_seat *seat)
list = &seat->compositor->cursor_layer.surface_list;
wl_list_insert(list, &seat->drag_surface->layer_link);
- weston_surface_assign_output(seat->drag_surface);
+ weston_surface_update_transform(seat->drag_surface);
empty_region(&seat->drag_surface->input);
}
diff --git a/src/shell.c b/src/shell.c
index dba54f7..2afa1b3 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2190,7 +2190,7 @@ lock_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy)
if (!weston_surface_is_mapped(surface)) {
wl_list_insert(&shell->lock_layer.surface_list,
&surface->layer_link);
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
weston_compositor_wake(shell->compositor);
}
}
@@ -2763,7 +2763,7 @@ show_input_panels(struct wl_listener *listener, void *data)
ws = surface->surface;
wl_list_insert(&shell->input_panel_layer.surface_list,
&ws->layer_link);
- weston_surface_assign_output(ws);
+ weston_surface_update_transform(ws);
weston_surface_damage(ws);
weston_slide_run(ws, ws->geometry.height, 0, NULL, NULL);
}
@@ -2918,7 +2918,7 @@ map(struct desktop_shell *shell, struct weston_surface *surface,
}
if (surface_type != SHELL_SURFACE_NONE) {
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
if (surface_type == SHELL_SURFACE_MAXIMIZED)
surface->output = shsurf->output;
}
@@ -2991,7 +2991,7 @@ configure(struct desktop_shell *shell, struct weston_surface *surface,
/* XXX: would a fullscreen surface need the same handling? */
if (surface->output) {
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
if (surface_type == SHELL_SURFACE_MAXIMIZED)
surface->output = shsurf->output;
@@ -3129,7 +3129,7 @@ screensaver_configure(struct weston_surface *surface, int32_t sx, int32_t sy)
if (wl_list_empty(&surface->layer_link)) {
wl_list_insert(shell->lock_layer.surface_list.prev,
&surface->layer_link);
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
shell->compositor->idle_time = shell->screensaver.duration;
weston_compositor_wake(shell->compositor);
shell->compositor->state = WESTON_COMPOSITOR_IDLE;
@@ -3468,7 +3468,6 @@ debug_repaint_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
weston_surface_configure(surface, 0, 0, 8192, 8192);
wl_list_insert(&compositor->fade_layer.surface_list,
&surface->layer_link);
- weston_surface_assign_output(surface);
pixman_region32_init(&surface->input);
/* Here's the dirty little trick that makes the
diff --git a/src/tablet-shell.c b/src/tablet-shell.c
index af5e66f..3623736 100644
--- a/src/tablet-shell.c
+++ b/src/tablet-shell.c
@@ -162,7 +162,7 @@ tablet_shell_surface_configure(struct weston_surface *surface,
&surface->layer_link);
}
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
}
static void
diff --git a/tests/event-test.c b/tests/event-test.c
index e137213..2cbfc2d 100644
--- a/tests/event-test.c
+++ b/tests/event-test.c
@@ -49,7 +49,7 @@ handle_surface(struct test_client *client)
surface = (struct weston_surface *) resource;
weston_surface_configure(surface, 100, 100, 200, 200);
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0);
wl_list_insert(&layer->surface_list, &surface->layer_link);
weston_surface_damage(surface);
diff --git a/tests/text-test.c b/tests/text-test.c
index 9b0f88c..942cb3b 100644
--- a/tests/text-test.c
+++ b/tests/text-test.c
@@ -178,7 +178,7 @@ handle_surface(struct test_client *client)
surface = (struct weston_surface *) resource;
weston_surface_configure(surface, 100, 100, 200, 200);
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0);
data->layer = malloc(sizeof *data->layer);