compositor: move output assignment to update_transform

Move the call to assign an output from weston_surface_configure() to
weston_surface_update_transform().

As update_transform takes new geometry into use, it should also reassign
the output for the surface, but only if an output was already assigned.

Add explicit assing output calls to where we relied on
weston_surface_configure() unconditionally assigning the output.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen 13 years ago
parent 730d87e6a6
commit f07cb5d5f0
  1. 14
      src/compositor.c
  2. 13
      src/shell.c
  3. 1
      src/tablet-shell.c

@ -387,6 +387,10 @@ weston_surface_update_transform(struct weston_surface *surface)
else else
pixman_region32_init(&surface->transform.opaque); pixman_region32_init(&surface->transform.opaque);
if (surface->output)
weston_surface_assign_output(surface);
weston_compositor_schedule_repaint(surface->compositor); weston_compositor_schedule_repaint(surface->compositor);
} }
@ -503,16 +507,11 @@ WL_EXPORT void
weston_surface_configure(struct weston_surface *surface, weston_surface_configure(struct weston_surface *surface,
GLfloat x, GLfloat y, int width, int height) GLfloat x, GLfloat y, int width, int height)
{ {
weston_surface_damage_below(surface);
surface->geometry.x = x; surface->geometry.x = x;
surface->geometry.y = y; surface->geometry.y = y;
surface->geometry.width = width; surface->geometry.width = width;
surface->geometry.height = height; surface->geometry.height = height;
surface->geometry.dirty = 1; surface->geometry.dirty = 1;
weston_surface_assign_output(surface);
weston_surface_damage(surface);
} }
WL_EXPORT uint32_t WL_EXPORT uint32_t
@ -1060,6 +1059,7 @@ weston_compositor_fade(struct weston_compositor *compositor, float tint)
weston_surface_configure(surface, 0, 0, 8192, 8192); weston_surface_configure(surface, 0, 0, 8192, 8192);
weston_surface_set_color(surface, 0.0, 0.0, 0.0, 0.0); weston_surface_set_color(surface, 0.0, 0.0, 0.0, 0.0);
wl_list_insert(&compositor->surface_list, &surface->link); wl_list_insert(&compositor->surface_list, &surface->link);
weston_surface_assign_output(surface);
compositor->fade.surface = surface; compositor->fade.surface = surface;
} }
@ -1700,9 +1700,11 @@ input_device_attach(struct wl_client *client,
return; return;
} }
if (!device->sprite->output) if (!device->sprite->output) {
wl_list_insert(&compositor->surface_list, wl_list_insert(&compositor->surface_list,
&device->sprite->link); &device->sprite->link);
weston_surface_assign_output(device->sprite);
}
buffer = buffer_resource->data; buffer = buffer_resource->data;
device->hotspot_x = x; device->hotspot_x = x;

@ -854,11 +854,13 @@ resume_desktop(struct wl_shell *shell)
terminate_screensaver(shell); terminate_screensaver(shell);
wl_list_for_each(surface, &shell->hidden_surface_list, link) wl_list_for_each(surface, &shell->hidden_surface_list, link) {
weston_surface_configure(surface, surface->geometry.x, weston_surface_configure(surface, surface->geometry.x,
surface->geometry.y, surface->geometry.y,
surface->geometry.width, surface->geometry.width,
surface->geometry.height); surface->geometry.height);
weston_surface_assign_output(surface);
}
if (wl_list_empty(&shell->backgrounds)) { if (wl_list_empty(&shell->backgrounds)) {
list = &shell->compositor->surface_list; list = &shell->compositor->surface_list;
@ -1392,6 +1394,7 @@ map(struct weston_shell *base,
weston_surface_configure(surface, surface->geometry.x, weston_surface_configure(surface, surface->geometry.x,
surface->geometry.y, surface->geometry.y,
width, height); width, height);
weston_surface_assign_output(surface);
weston_compositor_repick(compositor); weston_compositor_repick(compositor);
} }
@ -1441,14 +1444,10 @@ configure(struct weston_shell *base, struct weston_surface *surface,
break; break;
} }
/* /* XXX: would a fullscreen surface need the same handling? */
* weston_surface_configure() will assign an output, which means
* the surface is supposed to be in compositor->surface_list.
* Be careful with that, and make sure we stay on the right output.
* XXX: would a fullscreen surface need the same handling?
*/
if (do_configure) { if (do_configure) {
weston_surface_configure(surface, x, y, width, height); weston_surface_configure(surface, x, y, width, height);
weston_surface_assign_output(surface);
if (surface_type == SHELL_SURFACE_SCREENSAVER) if (surface_type == SHELL_SURFACE_SCREENSAVER)
surface->output = shsurf->output; surface->output = shsurf->output;

@ -136,6 +136,7 @@ tablet_shell_map(struct weston_shell *base, struct weston_surface *surface,
wl_list_insert(&shell->compositor->surface_list, &surface->link); wl_list_insert(&shell->compositor->surface_list, &surface->link);
weston_surface_configure(surface, surface->geometry.x, weston_surface_configure(surface, surface->geometry.x,
surface->geometry.y, width, height); surface->geometry.y, width, height);
weston_surface_assign_output(surface);
} }
static void static void

Loading…
Cancel
Save