mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Move flush_wayland_fd to input/common/wayland_common.c
This commit is contained in:
parent
4009919eca
commit
b7c2cbc6b2
@ -251,32 +251,6 @@ static void gfx_ctx_wl_destroy_resources(gfx_ctx_wayland_data_t *wl)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush_wayland_fd(void *data)
|
|
||||||
{
|
|
||||||
struct pollfd fd = {0};
|
|
||||||
input_ctx_wayland_data_t *wl = (input_ctx_wayland_data_t*)data;
|
|
||||||
|
|
||||||
wl_display_dispatch_pending(wl->dpy);
|
|
||||||
wl_display_flush(wl->dpy);
|
|
||||||
|
|
||||||
fd.fd = wl->fd;
|
|
||||||
fd.events = POLLIN | POLLOUT | POLLERR | POLLHUP;
|
|
||||||
|
|
||||||
if (poll(&fd, 1, 0) > 0)
|
|
||||||
{
|
|
||||||
if (fd.revents & (POLLERR | POLLHUP))
|
|
||||||
{
|
|
||||||
close(wl->fd);
|
|
||||||
frontend_driver_set_signal_handler_state(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fd.revents & POLLIN)
|
|
||||||
wl_display_dispatch(wl->dpy);
|
|
||||||
if (fd.revents & POLLOUT)
|
|
||||||
wl_display_flush(wl->dpy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
|
@ -666,3 +666,29 @@ const struct wl_pointer_listener pointer_listener = {
|
|||||||
pointer_handle_button,
|
pointer_handle_button,
|
||||||
pointer_handle_axis,
|
pointer_handle_axis,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void flush_wayland_fd(void *data)
|
||||||
|
{
|
||||||
|
struct pollfd fd = {0};
|
||||||
|
input_ctx_wayland_data_t *wl = (input_ctx_wayland_data_t*)data;
|
||||||
|
|
||||||
|
wl_display_dispatch_pending(wl->dpy);
|
||||||
|
wl_display_flush(wl->dpy);
|
||||||
|
|
||||||
|
fd.fd = wl->fd;
|
||||||
|
fd.events = POLLIN | POLLOUT | POLLERR | POLLHUP;
|
||||||
|
|
||||||
|
if (poll(&fd, 1, 0) > 0)
|
||||||
|
{
|
||||||
|
if (fd.revents & (POLLERR | POLLHUP))
|
||||||
|
{
|
||||||
|
close(wl->fd);
|
||||||
|
frontend_driver_set_signal_handler_state(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fd.revents & POLLIN)
|
||||||
|
wl_display_dispatch(wl->dpy);
|
||||||
|
if (fd.revents & POLLOUT)
|
||||||
|
wl_display_flush(wl->dpy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user