mirror of
https://github.com/labwc/labwc.git
synced 2026-02-22 01:40:25 -05:00
implement basic drag and drop
This commit is contained in:
parent
23f28e5082
commit
6bf3bb97f5
3 changed files with 70 additions and 1 deletions
23
src/output.c
23
src/output.c
|
|
@ -179,6 +179,26 @@ render_surface_iterator(struct output *output, struct wlr_surface *surface,
|
|||
render_texture(wlr_output, output_damage, texture, box, matrix);
|
||||
}
|
||||
|
||||
void
|
||||
output_drag_icon_for_each_surface(struct output *output, struct seat *seat,
|
||||
surface_iterator_func_t iterator, void *user_data)
|
||||
{
|
||||
if (!seat->drag_icon || !seat->drag_icon->mapped) {
|
||||
return;
|
||||
}
|
||||
output_surface_for_each_surface(output, seat->drag_icon->surface,
|
||||
seat->cursor->x, seat->cursor->y, iterator, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
render_drag_icon(struct output *output, pixman_region32_t *damage)
|
||||
{
|
||||
struct render_data data = {
|
||||
.damage = damage,
|
||||
};
|
||||
output_drag_icon_for_each_surface(output, &output->server->seat, render_surface_iterator, &data);
|
||||
}
|
||||
|
||||
#if HAVE_XWAYLAND
|
||||
void
|
||||
output_unmanaged_for_each_surface(struct output *output,
|
||||
|
|
@ -290,6 +310,7 @@ output_for_each_surface(struct output *output, surface_iterator_func_t iterator,
|
|||
output_layer_for_each_surface(output,
|
||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
|
||||
iterator, user_data);
|
||||
output_drag_icon_for_each_surface(output, &output->server->seat, iterator, user_data);
|
||||
}
|
||||
|
||||
struct send_frame_done_data {
|
||||
|
|
@ -707,6 +728,8 @@ output_render(struct output *output, pixman_region32_t *damage)
|
|||
render_osd(output, damage, output->server);
|
||||
}
|
||||
|
||||
render_drag_icon(output, damage);
|
||||
|
||||
render_layer_toplevel(output, damage,
|
||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]);
|
||||
render_layer_toplevel(output, damage,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue