static void data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab) { if (drag_grab->drag_origin) { drag_grab->drag_origin = NULL; wl_list_remove (&drag_grab->drag_origin_listener.link); } if (drag_grab->drag_surface) { drag_grab->drag_surface = NULL; wl_list_remove (&drag_grab->drag_icon_listener.link); } if (drag_grab->drag_data_source) { drag_grab->drag_data_source->has_target = FALSE; wl_list_remove (&drag_grab->drag_data_source_listener.link); } if (drag_grab->feedback_actor) { clutter_actor_remove_all_children (drag_grab->feedback_actor); clutter_actor_destroy (drag_grab->feedback_actor); } drag_grab->seat->data_device.current_grab = NULL; drag_grab_focus (&drag_grab->generic, NULL); meta_wayland_pointer_end_grab (drag_grab->generic.pointer); g_slice_free (MetaWaylandDragGrab, drag_grab); }
static void weston_zoom_frame_z(struct weston_animation *animation, struct weston_output *output, uint32_t msecs) { if (animation->frame_counter <= 1) output->zoom.spring_z.timestamp = msecs; weston_spring_update(&output->zoom.spring_z, msecs); if (output->zoom.spring_z.current > output->zoom.max_level) output->zoom.spring_z.current = output->zoom.max_level; else if (output->zoom.spring_z.current < 0.0) output->zoom.spring_z.current = 0.0; if (weston_spring_done(&output->zoom.spring_z)) { if (output->zoom.active && output->zoom.level <= 0.0) { output->zoom.active = 0; output->disable_planes--; wl_list_remove(&output->zoom.motion_listener.link); } output->zoom.spring_z.current = output->zoom.level; wl_list_remove(&animation->link); wl_list_init(&animation->link); } output->dirty = 1; weston_output_damage(output); }
ShellSeat::~ShellSeat() { if (m_popupGrab.client) { weston_pointer_end_grab(m_popupGrab.grab.pointer); } wl_list_remove(&m_listeners.seatDestroy.link); wl_list_remove(&m_listeners.focus.link); }
void e_mod_comp_wl_output_shutdown(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!_wl_output) return; wl_list_remove(&_wl_output->frame_callbacks); wl_list_remove(&_wl_output->link); free(_wl_output); }
static void popup_destroy(struct sway_view_child *child) { if (!sway_assert(child->impl == &popup_impl, "Expected an xdg_shell_v6 popup")) { return; } struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child; wl_list_remove(&popup->new_popup.link); wl_list_remove(&popup->destroy.link); free(popup); }
static void handle_destroy(struct wl_listener *listener, void *data) { struct sway_xdg_shell_v6_view *xdg_shell_v6_view = wl_container_of(listener, xdg_shell_v6_view, destroy); struct sway_view *view = &xdg_shell_v6_view->view; wl_list_remove(&xdg_shell_v6_view->destroy.link); wl_list_remove(&xdg_shell_v6_view->map.link); wl_list_remove(&xdg_shell_v6_view->unmap.link); view->wlr_xdg_surface_v6 = NULL; view_begin_destroy(view); }
static void weston_surface_animation_destroy(struct weston_surface_animation *animation) { wl_list_remove(&animation->animation.link); wl_list_remove(&animation->listener.link); wl_list_remove(&animation->transform.link); weston_surface_geometry_dirty(animation->surface); if (animation->done) animation->done(animation, animation->data); free(animation); }
static void clipboard_destroy(struct wl_listener *listener, void *data) { struct clipboard *clipboard = container_of(listener, struct clipboard, destroy_listener); wl_list_remove(&clipboard->selection_listener.link); wl_list_remove(&clipboard->destroy_listener.link); free(clipboard); }
static void handle_decoration_destroyed(wl_listener*, void *data) { auto decor = (wlr_server_decoration*) data; auto wd = (wf_server_decoration*) decor->data; wl_list_remove(&wd->mode_set.link); wl_list_remove(&wd->destroy.link); core->uses_csd.erase(wd->surface); delete wd; }
WL_EXPORT void weston_view_animation_destroy(struct weston_view_animation *animation) { wl_list_remove(&animation->animation.link); wl_list_remove(&animation->listener.link); wl_list_remove(&animation->transform.link); if (animation->reset) animation->reset(animation); weston_view_geometry_dirty(animation->view); if (animation->done) animation->done(animation, animation->data); free(animation); }
static void ss_shm_buffer_destroy(struct ss_shm_buffer *buffer) { pixman_image_unref(buffer->pm_image); wl_buffer_destroy(buffer->buffer); munmap(buffer->data, buffer->size); pixman_region32_fini(&buffer->damage); wl_list_remove(&buffer->link); wl_list_remove(&buffer->free_link); free(buffer); }
static void wayland_shm_buffer_destroy(struct wayland_shm_buffer *buffer) { cairo_surface_destroy(buffer->c_surface); pixman_image_unref(buffer->pm_image); wl_buffer_destroy(buffer->buffer); munmap(buffer->data, buffer->size); pixman_region32_fini(&buffer->damage); wl_list_remove(&buffer->link); wl_list_remove(&buffer->free_link); free(buffer); }
static void data_device_end_drag_grab(struct wl_seat *seat) { struct wl_resource *surface_resource; struct wl_surface_interface *implementation; if (seat->drag_surface) { surface_resource = &seat->drag_surface->resource; implementation = (struct wl_surface_interface *) surface_resource->object.implementation; implementation->attach(surface_resource->client, surface_resource, NULL, 0, 0); wl_list_remove(&seat->drag_icon_listener.link); } drag_grab_focus(&seat->drag_grab, NULL, wl_fixed_from_int(0), wl_fixed_from_int(0)); wl_pointer_end_grab(seat->pointer); seat->drag_data_source = NULL; seat->drag_surface = NULL; seat->drag_client = NULL; }
static void drag_grab_focus(struct wl_grab *grab, uint32_t time, struct wl_surface *surface, int32_t x, int32_t y) { struct wl_input_device *device = container_of(grab, struct wl_input_device, drag_grab); struct wl_resource *resource, *offer; if (device->drag_focus_resource) { wl_resource_post_event(device->drag_focus_resource, WL_DATA_DEVICE_LEAVE); wl_list_remove(&device->drag_focus_listener.link); device->drag_focus_resource = NULL; device->drag_focus = NULL; } if (surface) resource = find_resource(&device->drag_resource_list, surface->resource.client); if (surface && resource) { offer = wl_data_source_send_offer(device->drag_data_source, resource); wl_resource_post_event(resource, WL_DATA_DEVICE_ENTER, time, surface, x, y, offer); device->drag_focus = surface; device->drag_focus_listener.func = destroy_drag_focus; wl_list_insert(resource->destroy_listener_list.prev, &device->drag_focus_listener.link); device->drag_focus_resource = resource; grab->focus = surface; } }
UwacReturnCode UwacDestroyWindow(UwacWindow** pwindow) { UwacWindow* w; assert(pwindow); w = *pwindow; UwacWindowDestroyBuffers(w); if (w->frame_callback) wl_callback_destroy(w->frame_callback); if (w->xdg_surface) xdg_surface_destroy(w->xdg_surface); #if BUILD_IVI if (w->ivi_surface) ivi_surface_destroy(w->ivi_surface); #endif if (w->opaque_region) wl_region_destroy(w->opaque_region); if (w->input_region) wl_region_destroy(w->opaque_region); wl_surface_destroy(w->surface); wl_list_remove(&w->link); free(w); *pwindow = NULL; return UWAC_SUCCESS; }
void wlc_cleanup(void) { if (wlc.display) { wlc_log(WLC_LOG_INFO, "Cleanup wlc"); // fd process never allocates display wlc_compositor_release(&wlc.compositor); wl_list_remove(&compositor_listener.link); wlc_xwayland_terminate(); wlc_input_terminate(); wlc_udev_terminate(); wlc_fd_terminate(); } // however if main process crashed, fd process does // know enough about tty to reset it. wlc_tty_terminate(); if (wlc.display) wl_display_destroy(wlc.display); // reset te struct, but keep the wlc log state FILE *f = wlc.log_file; int cached_tm_mday = wlc.cached_tm_mday; memset(&wlc, 0, sizeof(wlc)); wlc_set_log_file(f); wlc.cached_tm_mday = cached_tm_mday; }
QWaylandClient::~QWaylandClient() { Q_D(QWaylandClient); // Remove listener from signal wl_list_remove(&d->listener.listener.link); }
ClientConnection::Private::~Private() { if (client) { wl_list_remove(&listener.link); } s_allClients.removeAt(s_allClients.indexOf(this)); }
static void cycle(struct wlc_compositor *compositor) { struct wl_list *l = wlc_space_get_userdata(wlc_compositor_get_focused_space(compositor)); if (!l) return; struct wlc_view *v; uint32_t count = 0; wlc_view_for_each_user(v, l) if (is_tiled(v)) ++count; // Check that we have at least two tiled views // so we don't get in infinite loop. if (count <= 1) return; // Cycle until we hit next tiled view. struct wl_list *p; do { p = l->prev; wl_list_remove(l->prev); wl_list_insert(l, p); } while (!is_tiled(wlc_view_from_user_link(p))); relayout(wlc_compositor_get_focused_space(compositor)); }
void Animation::stop() { if (isRunning()) { wl_list_remove(&m_animation.ani.link); wl_list_init(&m_animation.ani.link); } }
static void cogland_surface_attach (struct wl_client *wayland_client, struct wl_resource *wayland_surface_resource, struct wl_resource *wayland_buffer_resource, int32_t sx, int32_t sy) { CoglandSurface *surface = wl_resource_get_user_data (wayland_surface_resource); CoglandBuffer *buffer; if (wayland_buffer_resource) buffer = cogland_buffer_from_resource (wayland_buffer_resource); else buffer = NULL; /* Attach without commit in between does not went wl_buffer.release */ if (surface->pending.buffer) wl_list_remove (&surface->pending.buffer_destroy_listener.link); surface->pending.sx = sx; surface->pending.sy = sy; surface->pending.buffer = buffer; surface->pending.newly_attached = TRUE; if (buffer) wl_signal_add (&buffer->destroy_signal, &surface->pending.buffer_destroy_listener); }
static void set_selection(struct wl_client * client, struct wl_resource * resource, struct wl_resource * data_source, uint32_t serial) { struct data_device * data_device = wl_resource_get_user_data(resource); /* Check if this data source is already the current selection. */ if (data_source == data_device->selection) return; if (data_device->selection) { wl_data_source_send_cancelled(data_device->selection); wl_list_remove(&data_device->selection_destroy_listener.link); } data_device->selection = data_source; if (data_source) { wl_resource_add_destroy_listener (data_source, &data_device->selection_destroy_listener); } swc_send_event(&data_device->event_signal, DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL); }
void wlb_keyboard_set_focus(struct wlb_keyboard *keyboard, struct wlb_surface *focus) { struct wl_resource *resource; uint32_t serial; if (keyboard->focus == focus) return; serial = wl_display_next_serial(keyboard->seat->compositor->display); if (keyboard->focus) { wl_resource_for_each(resource, &keyboard->resource_list) wl_keyboard_send_leave(resource, serial, keyboard->focus->resource); wl_list_remove(&keyboard->surface_destroy_listener.link); } keyboard->focus = focus; if (keyboard->focus) { wl_resource_add_destroy_listener(focus->resource, &keyboard->surface_destroy_listener); wl_resource_for_each(resource, &keyboard->resource_list) wl_keyboard_send_enter(resource, serial, keyboard->focus->resource, &keyboard->keys); } }
static void pixman_renderer_surface_state_destroy(struct pixman_surface_state *ps) { wl_list_remove(&ps->surface_destroy_listener.link); wl_list_remove(&ps->renderer_destroy_listener.link); ps->surface->renderer_state = NULL; if (ps->image) { pixman_image_unref(ps->image); ps->image = NULL; } weston_buffer_reference(&ps->buffer_ref, NULL); free(ps); }
static void cogland_buffer_reference (CoglandBufferReference *ref, CoglandBuffer *buffer) { if (ref->buffer && buffer != ref->buffer) { ref->buffer->busy_count--; if (ref->buffer->busy_count == 0) { g_assert (wl_resource_get_client (ref->buffer->resource)); wl_resource_queue_event (ref->buffer->resource, WL_BUFFER_RELEASE); } wl_list_remove (&ref->destroy_listener.link); } if (buffer && buffer != ref->buffer) { buffer->busy_count++; wl_signal_add (&buffer->destroy_signal, &ref->destroy_listener); } ref->buffer = buffer; ref->destroy_listener.notify = cogland_buffer_reference_handle_destroy; }
static void weston_desktop_seat_popup_grab_end(struct weston_desktop_seat *seat) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat->seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat->seat); struct weston_touch *touch = weston_seat_get_touch(seat->seat); while (!wl_list_empty(&seat->popup_grab.surfaces)) { struct wl_list *link = seat->popup_grab.surfaces.prev; struct weston_desktop_surface *surface = weston_desktop_surface_from_grab_link(link); wl_list_remove(link); wl_list_init(link); weston_desktop_surface_popup_dismiss(surface); } if (keyboard != NULL && keyboard->grab->interface == &weston_desktop_seat_keyboard_popup_grab_interface) weston_keyboard_end_grab(keyboard); if (pointer != NULL && pointer->grab->interface == &weston_desktop_seat_pointer_popup_grab_interface) weston_pointer_end_grab(pointer); if (touch != NULL && touch->grab->interface == &weston_desktop_seat_touch_popup_grab_interface) weston_touch_end_grab(touch); seat->popup_grab.client = NULL; }
static void cogland_surface_free (CoglandSurface *surface) { CoglandCompositor *compositor = surface->compositor; CoglandFrameCallback *cb, *next; wl_signal_emit (&surface->destroy_signal, &surface->resource); compositor->surfaces = g_list_remove (compositor->surfaces, surface); cogland_buffer_reference (&surface->buffer_ref, NULL); if (surface->texture) cogl_object_unref (surface->texture); if (surface->pending.buffer) wl_list_remove (&surface->pending.buffer_destroy_listener.link); wl_list_for_each_safe (cb, next, &surface->pending.frame_callback_list, link) wl_resource_destroy (cb->resource); g_slice_free (CoglandSurface, surface); cogland_queue_redraw (compositor); }
static void weston_zoom_frame_xy(struct weston_animation *animation, struct weston_output *output, uint32_t msecs) { struct weston_seat *seat = weston_zoom_pick_seat(output->compositor); wl_fixed_t x, y; if (animation->frame_counter <= 1) output->zoom.spring_xy.timestamp = msecs; weston_spring_update(&output->zoom.spring_xy, msecs); x = output->zoom.from.x - ((output->zoom.from.x - output->zoom.to.x) * output->zoom.spring_xy.current); y = output->zoom.from.y - ((output->zoom.from.y - output->zoom.to.y) * output->zoom.spring_xy.current); output->zoom.current.x = x; output->zoom.current.y = y; if (weston_spring_done(&output->zoom.spring_xy)) { output->zoom.spring_xy.current = output->zoom.spring_xy.target; output->zoom.current.x = seat->pointer->x; output->zoom.current.y = seat->pointer->y; wl_list_remove(&animation->link); wl_list_init(&animation->link); } output->dirty = 1; weston_output_damage(output); }
void wlc_cleanup(void) { if (wlc.display) { wlc_log(WLC_LOG_INFO, "Cleanup wlc"); // fd process never allocates display wlc_compositor_release(&wlc.compositor); wl_list_remove(&compositor_listener.link); wlc_xwayland_terminate(); wlc_resources_terminate(); wlc_input_terminate(); wlc_udev_terminate(); wlc_fd_terminate(); } // however if main process crashed, fd process does // know enough about tty to reset it. wlc_tty_terminate(); if (wlc.display) wl_display_destroy(wlc.display); memset(&wlc, 0, sizeof(wlc)); }
void SurfaceBuffer::destructBufferState() { destroyTexture(); if (m_buffer) { sendRelease(); if (m_handle) { if (m_shmBuffer) { delete static_cast<QImage *>(m_handle); #ifdef QT_COMPOSITOR_WAYLAND_GL } else { QWaylandClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration(); hwIntegration->unlockNativeBuffer(m_handle, 0); #endif } } wl_list_remove(&m_destroy_listener.listener.link); } m_buffer = 0; m_handle = 0; m_committed = false; m_is_registered_for_buffer = false; m_is_displayed = false; m_image = QImage(); }