Skip to content
Commits on Source (7)
......@@ -269,6 +269,7 @@ fs_output_destroy(struct fs_output *fsout)
if (fsout->output)
wl_list_remove(&fsout->output_destroyed.link);
free(fsout);
}
static void
......@@ -316,6 +317,7 @@ fs_output_create(struct fullscreen_shell *shell, struct weston_output *output)
fsout->shell = shell;
wl_list_insert(&shell->output_list, &fsout->link);
wl_list_init(&fsout->transform.link);
fsout->output = output;
fsout->output_destroyed.notify = output_destroyed;
......@@ -326,10 +328,8 @@ fs_output_create(struct fullscreen_shell *shell, struct weston_output *output)
fsout->curtain = create_curtain(shell->compositor, fsout,
output->pos,
output->width, output->height);
fsout->curtain->view->is_mapped = true;
weston_layer_entry_insert(&shell->layer.view_list,
&fsout->curtain->view->layer_link);
wl_list_init(&fsout->transform.link);
weston_view_move_to_layer(fsout->curtain->view,
&shell->layer.view_list);
if (!wl_list_empty(&shell->default_surface_list)) {
surf = container_of(shell->default_surface_list.prev,
......@@ -580,6 +580,12 @@ configure_presented_surface_internal(struct weston_surface *surface)
if (surface->committed != configure_presented_surface)
return;
if (!weston_surface_has_content(surface))
return;
if (!weston_surface_is_mapped(surface))
weston_surface_map(surface);
wl_list_for_each(fsout, &shell->output_list, link)
if (fsout->surface == surface ||
fsout->pending.surface == surface)
......@@ -591,6 +597,10 @@ fs_output_apply_pending(struct fs_output *fsout)
{
assert(fsout->pending.surface);
if (!weston_surface_is_mapped(fsout->pending.surface) &&
!weston_surface_has_content(fsout->pending.surface))
return;
if (fsout->surface && fsout->surface != fsout->pending.surface) {
wl_list_remove(&fsout->surface_destroyed.link);
......@@ -611,13 +621,14 @@ fs_output_apply_pending(struct fs_output *fsout)
if (fsout->surface != fsout->pending.surface) {
fsout->surface = fsout->pending.surface;
if (!weston_surface_is_mapped(fsout->surface))
weston_surface_map(fsout->surface);
fsout->view = weston_view_create(fsout->surface);
if (!fsout->view) {
weston_log("no memory\n");
return;
}
fsout->surface->is_mapped = true;
wl_signal_add(&fsout->surface->destroy_signal,
&fsout->surface_destroyed);
......
......@@ -961,7 +961,6 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
shsurf->output);
struct kiosk_shell_seat *kiosk_seat;
shsurf->view->is_mapped = true;
weston_surface_map(surface);
kiosk_seat = get_kiosk_shell_seat(seat);
......
......@@ -421,18 +421,16 @@ drag_surface_configure(struct weston_drag *drag,
(pointer == NULL && touch != NULL));
if (!weston_surface_is_mapped(es) && weston_surface_has_content(es)) {
weston_surface_map(es);
pixman_region32_clear(&es->pending.input);
if (pointer && pointer->sprite &&
weston_view_is_mapped(pointer->sprite))
list = &pointer->sprite->layer_link;
else
list = &es->compositor->cursor_layer.view_list;
weston_layer_entry_remove(&drag->icon->layer_link);
weston_layer_entry_insert(list, &drag->icon->layer_link);
weston_view_update_transform(drag->icon);
pixman_region32_clear(&es->pending.input);
weston_surface_map(es);
drag->icon->is_mapped = true;
weston_view_move_to_layer(drag->icon, list);
}
drag->offset = weston_coord_surface_add(drag->offset, new_origin);
......
......@@ -3224,12 +3224,9 @@ tablet_tool_cursor_surface_committed(struct weston_surface *es,
empty_region(&es->input);
if (!weston_surface_is_mapped(es)) {
weston_layer_entry_insert(
&es->compositor->cursor_layer.view_list,
&tool->sprite->layer_link);
weston_view_update_transform(tool->sprite);
es->is_mapped = true;
tool->sprite->is_mapped = true;
weston_surface_map(es);
weston_view_move_to_layer(tool->sprite,
&es->compositor->cursor_layer.view_list);
}
}
......@@ -3520,11 +3517,9 @@ pointer_cursor_surface_committed(struct weston_surface *es,
empty_region(&es->input);
if (!weston_surface_is_mapped(es)) {
weston_layer_entry_insert(&es->compositor->cursor_layer.view_list,
&pointer->sprite->layer_link);
weston_view_update_transform(pointer->sprite);
weston_surface_map(es);
pointer->sprite->is_mapped = true;
weston_view_move_to_layer(pointer->sprite,
&es->compositor->cursor_layer.view_list);
}
}
......
......@@ -189,6 +189,7 @@ map_calibrator(struct weston_touch_calibrator *calibrator)
assert(calibrator->output);
assert(calibrator->surface);
assert(calibrator->surface->resource);
assert(weston_surface_is_mapped(calibrator->surface));
calibrator->view = weston_view_create(calibrator->surface);
if (!calibrator->view) {
......@@ -196,17 +197,9 @@ map_calibrator(struct weston_touch_calibrator *calibrator)
return;
}
weston_layer_entry_insert(&c->calibrator_layer.view_list,
&calibrator->view->layer_link);
weston_view_set_position(calibrator->view, calibrator->output->pos);
calibrator->view->output = calibrator->surface->output;
calibrator->view->is_mapped = true;
calibrator->surface->output = calibrator->output;
weston_surface_map(calibrator->surface);
weston_output_schedule_repaint(calibrator->output);
weston_view_move_to_layer(calibrator->view,
&c->calibrator_layer.view_list);
device->ops->get_calibration(device, &device->saved_calibration);
device->ops->set_calibration(device, &identity);
......@@ -260,6 +253,13 @@ touch_calibrator_surface_committed(struct wl_listener *listener, void *data)
wl_list_remove(&calibrator->surface_commit_listener.link);
wl_list_init(&calibrator->surface_commit_listener.link);
if (!weston_surface_has_content(surface)) {
wl_resource_post_error(calibrator->resource,
WESTON_TOUCH_CALIBRATOR_ERROR_BAD_SIZE,
"calibrator surface size has no content");
return;
}
if (surface->width != calibrator->output->width ||
surface->height != calibrator->output->height) {
wl_resource_post_error(calibrator->resource,
......@@ -268,6 +268,8 @@ touch_calibrator_surface_committed(struct wl_listener *listener, void *data)
return;
}
weston_surface_map(surface);
weston_compositor_set_touch_mode_calib(calibrator->compositor);
/* results in call to touch_calibrator_mode_changed() */
}
......