compositor: Don't destroy sprite surface, just hide it
This commit is contained in:
parent
0212723185
commit
aded1f6823
|
@ -1668,19 +1668,16 @@ input_device_attach(struct wl_client *client,
|
||||||
if (device->sprite)
|
if (device->sprite)
|
||||||
weston_surface_damage_below(device->sprite);
|
weston_surface_damage_below(device->sprite);
|
||||||
|
|
||||||
if (!buffer_resource) {
|
if (!buffer_resource && device->sprite->output) {
|
||||||
if (device->sprite) {
|
wl_list_remove(&device->sprite->link);
|
||||||
destroy_surface(&device->sprite->surface.resource);
|
device->sprite->visual = WESTON_NONE_VISUAL;
|
||||||
device->sprite = NULL;
|
device->sprite->output = NULL;
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!device->sprite) {
|
if (!device->sprite->output)
|
||||||
device->sprite = weston_surface_create(compositor);
|
|
||||||
wl_list_insert(&compositor->surface_list,
|
wl_list_insert(&compositor->surface_list,
|
||||||
&device->sprite->link);
|
&device->sprite->link);
|
||||||
}
|
|
||||||
|
|
||||||
buffer = buffer_resource->data;
|
buffer = buffer_resource->data;
|
||||||
device->hotspot_x = x;
|
device->hotspot_x = x;
|
||||||
|
@ -1725,7 +1722,7 @@ weston_input_device_init(struct weston_input_device *device,
|
||||||
wl_display_add_global(ec->wl_display, &wl_input_device_interface,
|
wl_display_add_global(ec->wl_display, &wl_input_device_interface,
|
||||||
device, bind_input_device);
|
device, bind_input_device);
|
||||||
|
|
||||||
device->sprite = NULL;
|
device->sprite = weston_surface_create(ec);
|
||||||
|
|
||||||
device->compositor = ec;
|
device->compositor = ec;
|
||||||
device->hotspot_x = 16;
|
device->hotspot_x = 16;
|
||||||
|
|
Loading…
Reference in New Issue