mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-21 05:33:55 -04:00
parent
1f85e1061b
commit
112a662ebc
3 changed files with 100 additions and 0 deletions
22
output.c
22
output.c
|
|
@ -15,6 +15,7 @@
|
|||
#include <wayland-server.h>
|
||||
#include <wlr/backend.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
|
|
@ -78,6 +79,25 @@ render_surface(struct wlr_surface *surface, int sx, int sy, void *data)
|
|||
wlr_surface_send_frame_done(surface, rdata->when);
|
||||
}
|
||||
|
||||
static void
|
||||
drag_icons_for_each_surface(struct cg_server *server, wlr_surface_iterator_func_t iterator,
|
||||
void *data)
|
||||
{
|
||||
struct render_data *rdata = data;
|
||||
|
||||
struct cg_drag_icon *drag_icon;
|
||||
wl_list_for_each(drag_icon, &server->seat->drag_icons, link) {
|
||||
if (!drag_icon->wlr_drag_icon->mapped) {
|
||||
continue;
|
||||
}
|
||||
rdata->x = drag_icon->x;
|
||||
rdata->y = drag_icon->y;
|
||||
wlr_surface_for_each_surface(drag_icon->wlr_drag_icon->surface,
|
||||
iterator,
|
||||
data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_output_frame(struct wl_listener *listener, void *data)
|
||||
{
|
||||
|
|
@ -119,6 +139,8 @@ handle_output_frame(struct wl_listener *listener, void *data)
|
|||
}
|
||||
}
|
||||
|
||||
drag_icons_for_each_surface(output->server, render_surface, &rdata);
|
||||
|
||||
wlr_renderer_end(renderer);
|
||||
wlr_output_swap_buffers(output->wlr_output, NULL, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue