struct weston_surface, link);
if (es->visual != WESTON_RGB_VISUAL ||
- es->x != output->base.x ||
- es->y != output->base.y ||
+ es->geometry.x != output->base.x ||
+ es->geometry.y != output->base.y ||
es->width != output->base.current->width ||
es->height != output->base.current->height ||
es->image == EGL_NO_IMAGE_KHR)
}
pixman_region32_init_rect(&cursor_region,
- eid->sprite->x, eid->sprite->y,
+ eid->sprite->geometry.x,
+ eid->sprite->geometry.y,
eid->sprite->width, eid->sprite->height);
pixman_region32_intersect_rect(&cursor_region, &cursor_region,
}
ret = drmModeMoveCursor(c->drm.fd, output->crtc_id,
- eid->sprite->x - output->base.x,
- eid->sprite->y - output->base.y);
+ eid->sprite->geometry.x - output->base.x,
+ eid->sprite->geometry.y - output->base.y);
if (ret) {
fprintf(stderr, "failed to move cursor: %s\n", strerror(-ret));
goto out;
surface->compositor = compositor;
surface->visual = WESTON_NONE_VISUAL;
surface->image = EGL_NO_IMAGE_KHR;
- surface->x = x;
- surface->y = y;
+ surface->geometry.x = x;
+ surface->geometry.y = y;
surface->width = width;
surface->height = height;
surface->alpha = 255;
surface->transform.enabled = 1;
- surface->transform.position.matrix.d[12] = surface->x;
- surface->transform.position.matrix.d[13] = surface->y;
+ surface->transform.position.matrix.d[12] = surface->geometry.x;
+ surface->transform.position.matrix.d[13] = surface->geometry.y;
weston_matrix_init(matrix);
wl_list_for_each(tform, &surface->geometry.transformation_list, link)
*x = floorf(v.f[0] / v.f[3]);
*y = floorf(v.f[1] / v.f[3]);
} else {
- *x = sx + surface->x;
- *y = sy + surface->y;
+ *x = sx + surface->geometry.x;
+ *y = sy + surface->geometry.y;
}
}
*sx = v.f[0] / v.f[3];
*sy = v.f[1] / v.f[3];
} else {
- *sx = x - surface->x;
- *sy = y - surface->y;
+ *sx = x - surface->geometry.x;
+ *sy = y - surface->geometry.y;
}
}
pixman_region32_union_rect(&surface->damage,
&surface->damage,
- surface->x + x, surface->y + y,
+ surface->geometry.x + x,
+ surface->geometry.y + y,
width, height);
weston_compositor_schedule_repaint(compositor);
}
pixman_region32_union_rect(&below->damage,
&below->damage,
- surface->x, surface->y,
+ surface->geometry.x, surface->geometry.y,
surface->width, surface->height);
weston_compositor_schedule_repaint(surface->compositor);
}
{
weston_surface_damage_below(surface);
- surface->x = x;
- surface->y = y;
+ surface->geometry.x = x;
+ surface->geometry.y = y;
surface->width = width;
surface->height = height;
surface->geometry.dirty = 1;
pixman_region32_fini(&surface->opaque);
if (surface->visual == WESTON_RGB_VISUAL)
pixman_region32_init_rect(&surface->opaque,
- surface->x, surface->y,
+ surface->geometry.x,
+ surface->geometry.y,
surface->width, surface->height);
else
pixman_region32_init(&surface->opaque);
int n;
pixman_region32_init_rect(&repaint,
- es->x, es->y, es->width, es->height);
+ es->geometry.x, es->geometry.y,
+ es->width, es->height);
pixman_region32_intersect(&repaint, &repaint, &output->region);
pixman_region32_intersect(&repaint, &repaint, &es->damage);
return;
pixman_region32_init_rect(&cursor_region,
- device->sprite->x, device->sprite->y,
+ device->sprite->geometry.x,
+ device->sprite->geometry.y,
device->sprite->width,
device->sprite->height);
wl_list_for_each(es, &ec->surface_list, link) {
pixman_region32_init(&surface_overlap);
pixman_region32_intersect_rect(&surface_overlap,
- &overlap, es->x, es->y,
+ &overlap,
+ es->geometry.x, es->geometry.y,
es->width, es->height);
es->overlapped = pixman_region32_not_empty(&surface_overlap);
pixman_region32_fini(&surface_overlap);
- pixman_region32_union_rect(&overlap, &overlap, es->x, es->y,
+ pixman_region32_union_rect(&overlap, &overlap,
+ es->geometry.x, es->geometry.y,
es->width, es->height);
}
max = 0;
wl_list_for_each(output, &ec->output_list, link) {
pixman_region32_init_rect(®ion,
- es->x, es->y, es->width, es->height);
+ es->geometry.x, es->geometry.y,
+ es->width, es->height);
pixman_region32_intersect(®ion, ®ion, &output->region);
e = pixman_region32_extents(®ion);
} else if (x != 0 || y != 0 ||
es->width != buffer->width ||
es->height != buffer->height) {
- shell->configure(shell, es, es->x + x, es->y + y,
+ /* FIXME: the x,y delta should be in surface-local coords */
+ shell->configure(shell, es, es->geometry.x + x,
+ es->geometry.y + y,
buffer->width, buffer->height);
}
if (wd->sprite) {
weston_surface_damage_below(wd->sprite);
- wd->sprite->x = device->x - wd->hotspot_x;
- wd->sprite->y = device->y - wd->hotspot_y;
+ wd->sprite->geometry.x = device->x - wd->hotspot_x;
+ wd->sprite->geometry.y = device->y - wd->hotspot_y;
wd->sprite->geometry.dirty = 1;
weston_surface_damage(wd->sprite);
device->hotspot_y = y;
device->sprite->width = buffer->width;
device->sprite->height = buffer->height;
- device->sprite->x = device->input_device.x - device->hotspot_x;
- device->sprite->y = device->input_device.y - device->hotspot_y;
+ device->sprite->geometry.x = device->input_device.x - device->hotspot_x;
+ device->sprite->geometry.y = device->input_device.y - device->hotspot_y;
device->sprite->geometry.dirty = 1;
weston_surface_damage(device->sprite);
GLuint texture;
pixman_region32_t damage;
pixman_region32_t opaque;
- int32_t x, y, width, height;
+ int32_t width, height;
int32_t pitch;
struct wl_list link;
struct wl_list buffer_link;
* That includes the transformations referenced from the list.
*/
struct {
+ int32_t x, y; /* surface translation on display */
+
/* struct weston_transform */
struct wl_list transformation_list;
return -1;
move->grab.interface = &move_grab_interface;
- move->dx = es->x - wd->input_device.grab_x;
- move->dy = es->y - wd->input_device.grab_y;
+ move->dx = es->geometry.x - wd->input_device.grab_x;
+ move->dy = es->geometry.y - wd->input_device.grab_y;
move->surface = es;
wl_input_device_start_grab(&wd->input_device, &move->grab, time);
resize->grab.interface = &resize_grab_interface;
resize->edges = edges;
- resize->dx = es->x - wd->input_device.grab_x;
- resize->dy = es->y - wd->input_device.grab_y;
+ resize->dx = es->geometry.x - wd->input_device.grab_x;
+ resize->dy = es->geometry.y - wd->input_device.grab_y;
resize->width = es->width;
resize->height = es->height;
resize->shsurf = shsurf;
{
switch (surface->type) {
case SHELL_SURFACE_FULLSCREEN:
- surface->surface->x = surface->saved_x;
- surface->surface->y = surface->saved_y;
+ surface->surface->geometry.x = surface->saved_x;
+ surface->surface->geometry.y = surface->saved_y;
+ surface->surface->geometry.dirty = 1;
surface->surface->fullscreen_output = NULL;
break;
case SHELL_SURFACE_PANEL:
/* assign to parents output */
es->output = pes->output;
- es->x = pes->x + x;
- es->y = pes->y + y;
+ es->geometry.x = pes->geometry.x + x;
+ es->geometry.y = pes->geometry.y + y;
+ es->geometry.dirty = 1;
weston_surface_damage(es);
shsurf->type = SHELL_SURFACE_TRANSIENT;
output = get_default_output(es->compositor);
es->output = output;
- shsurf->saved_x = es->x;
- shsurf->saved_y = es->y;
- es->x = (output->current->width - es->width) / 2;
- es->y = (output->current->height - es->height) / 2;
+ shsurf->saved_x = es->geometry.x;
+ shsurf->saved_y = es->geometry.y;
+ es->geometry.x = (output->current->width - es->width) / 2;
+ es->geometry.y = (output->current->height - es->height) / 2;
+ es->geometry.dirty = 1;
es->fullscreen_output = output;
weston_surface_damage(es);
shsurf->type = SHELL_SURFACE_FULLSCREEN;
shsurf->popup.grab.interface = &popup_grab_interface;
device = es->compositor->input_device;
- es->x = shsurf->parent->surface->x + shsurf->popup.x;
- es->y = shsurf->parent->surface->y + shsurf->popup.y;
+ es->geometry.x = shsurf->parent->surface->geometry.x + shsurf->popup.x;
+ es->geometry.y = shsurf->parent->surface->geometry.y + shsurf->popup.y;
+ es->geometry.dirty = 1;
shsurf->popup.grab.input_device = device;
shsurf->popup.time = device->grab_time;
wl_list_remove(&surface->surface->link);
wl_list_insert(list, &surface->surface->link);
weston_surface_configure(surface->surface,
- surface->surface->x,
- surface->surface->y,
+ surface->surface->geometry.x,
+ surface->surface->geometry.y,
surface->surface->width,
surface->surface->height);
surface->surface->output = surface->output;
wl_list_insert(&shell->backgrounds, &shsurf->link);
- surface->x = shsurf->output->x;
- surface->y = shsurf->output->y;
+ surface->geometry.x = shsurf->output->x;
+ surface->geometry.y = shsurf->output->y;
+ surface->geometry.dirty = 1;
wl_resource_post_event(resource,
DESKTOP_SHELL_CONFIGURE,
wl_list_insert(&shell->panels, &shsurf->link);
- surface->x = shsurf->output->x;
- surface->y = shsurf->output->y;
+ surface->geometry.x = shsurf->output->x;
+ surface->geometry.y = shsurf->output->y;
+ surface->geometry.dirty = 1;
wl_resource_post_event(resource,
DESKTOP_SHELL_CONFIGURE,
terminate_screensaver(shell);
wl_list_for_each(surface, &shell->hidden_surface_list, link)
- weston_surface_configure(surface, surface->x, surface->y,
- surface->width, surface->height);
+ weston_surface_configure(surface, surface->geometry.x,
+ surface->geometry.y,
+ surface->width, surface->height);
if (wl_list_empty(&shell->backgrounds)) {
list = &shell->compositor->surface_list;
break;
}
- x = device->grab_x - surface->x;
- y = device->grab_y - surface->y;
+ x = device->grab_x - surface->geometry.x;
+ y = device->grab_y - surface->geometry.y;
if (x < surface->width / 3)
edges |= WL_SHELL_SURFACE_RESIZE_LEFT;
{
struct weston_mode *mode = output->current;
- surface->x = output->x + (mode->width - surface->width) / 2;
- surface->y = output->y + (mode->height - surface->height) / 2;
+ surface->geometry.x = output->x + (mode->width - surface->width) / 2;
+ surface->geometry.y = output->y + (mode->height - surface->height) / 2;
+ surface->geometry.dirty = 1;
}
static void
/* initial positioning, see also configure() */
switch (surface_type) {
case SHELL_SURFACE_TOPLEVEL:
- surface->x = 10 + random() % 400;
- surface->y = 10 + random() % 400;
+ surface->geometry.x = 10 + random() % 400;
+ surface->geometry.y = 10 + random() % 400;
+ surface->geometry.dirty = 1;
break;
case SHELL_SURFACE_SCREENSAVER:
case SHELL_SURFACE_FULLSCREEN:
switch (surface_type) {
case SHELL_SURFACE_TOPLEVEL:
- surface->x = 10 + random() % 400;
- surface->y = 10 + random() % 400;
+ surface->geometry.x = 10 + random() % 400;
+ surface->geometry.y = 10 + random() % 400;
+ surface->geometry.dirty = 1;
break;
case SHELL_SURFACE_POPUP:
shell_map_popup(shsurf, shsurf->popup.time);
surface->width = width;
surface->height = height;
if (do_configure) {
- weston_surface_configure(surface, surface->x, surface->y,
+ weston_surface_configure(surface, surface->geometry.x,
+ surface->geometry.y,
width, height);
weston_compositor_repick(compositor);
}
struct tablet_shell *shell =
container_of(base, struct tablet_shell, shell);
- surface->x = 0;
- surface->y = 0;
+ surface->geometry.x = 0;
+ surface->geometry.y = 0;
+ surface->geometry.dirty = 1;
if (surface == shell->lockscreen_surface) {
/* */
}
wl_list_insert(&shell->compositor->surface_list, &surface->link);
- weston_surface_configure(surface, surface->x, surface->y, width, height);
+ weston_surface_configure(surface, surface->geometry.x,
+ surface->geometry.y, width, height);
}
static void
struct tablet_shell *shell = resource->data;
struct weston_surface *es = surface_resource->data;
- es->x = 0;
- es->y = 0;
+ es->geometry.x = 0;
+ es->geometry.y = 0;
+ es->geometry.dirty = 1;
shell->lockscreen_surface = es;
shell->lockscreen_listener.func = handle_lockscreen_surface_destroy;
wl_list_insert(es->surface.resource.destroy_listener_list.prev,
* layer idea, we should be able to hit the framerate on the
* fade/zoom in. */
shell->switcher_surface = es;
- shell->switcher_surface->x = 0;
- shell->switcher_surface->y = 0;
+ shell->switcher_surface->geometry.x = 0;
+ shell->switcher_surface->geometry.y = 0;
+ shell->switcher_surface->geometry.dirty = 1;
shell->switcher_listener.func = handle_switcher_surface_destroy;
wl_list_insert(es->surface.resource.destroy_listener_list.prev,
struct tablet_shell *shell = resource->data;
shell->home_surface = surface_resource->data;
- shell->home_surface->x = 0;
- shell->home_surface->y = 0;
+ shell->home_surface->geometry.x = 0;
+ shell->home_surface->geometry.y = 0;
+ shell->home_surface->geometry.dirty = 1;
}
static void
(zoom->stop - zoom->start) * zoom->spring.current;
weston_matrix_init(&zoom->transform.matrix);
weston_matrix_translate(&zoom->transform.matrix,
- -(es->x + es->width / 2.0),
- -(es->y + es->height / 2.0), 0);
+ -(es->geometry.x + es->width / 2.0),
+ -(es->geometry.y + es->height / 2.0), 0);
weston_matrix_scale(&zoom->transform.matrix, scale, scale, scale);
weston_matrix_translate(&zoom->transform.matrix,
- es->x + es->width / 2.0,
- es->y + es->height / 2.0, 0);
+ es->geometry.x + es->width / 2.0,
+ es->geometry.y + es->height / 2.0, 0);
es->alpha = zoom->spring.current * 255;
if (es->alpha > 255)