mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-25 01:40:19 -05:00
render: xcursor: remove render_xcursor_refresh()
This commit is contained in:
parent
00479fe204
commit
f4e8a9c375
1 changed files with 17 additions and 18 deletions
35
render.c
35
render.c
|
|
@ -1106,8 +1106,6 @@ static const struct wl_callback_listener xcursor_listener = {
|
||||||
static void
|
static void
|
||||||
render_xcursor_update(struct wayland *wayl, const struct terminal *term)
|
render_xcursor_update(struct wayland *wayl, const struct terminal *term)
|
||||||
{
|
{
|
||||||
wayl->pointer.pending_terminal = NULL;
|
|
||||||
|
|
||||||
/* If called from a frame callback, we may no longer have mouse focus */
|
/* If called from a frame callback, we may no longer have mouse focus */
|
||||||
if (wayl->mouse_focus != term)
|
if (wayl->mouse_focus != term)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1144,19 +1142,6 @@ render_xcursor_update(struct wayland *wayl, const struct terminal *term)
|
||||||
wl_surface_commit(wayl->pointer.surface);
|
wl_surface_commit(wayl->pointer.surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
render_xcursor_refresh(struct wayland *wayl)
|
|
||||||
{
|
|
||||||
if (wayl->pointer.pending_terminal == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (wayl->pointer.xcursor_callback == NULL)
|
|
||||||
render_xcursor_update(wayl, wayl->pointer.pending_terminal);
|
|
||||||
else {
|
|
||||||
/* Frame callback will call render_xcursor_update() */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xcursor_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_data)
|
xcursor_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_data)
|
||||||
{
|
{
|
||||||
|
|
@ -1166,13 +1151,18 @@ xcursor_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_
|
||||||
wl_callback_destroy(wl_callback);
|
wl_callback_destroy(wl_callback);
|
||||||
wayl->pointer.xcursor_callback = NULL;
|
wayl->pointer.xcursor_callback = NULL;
|
||||||
|
|
||||||
render_xcursor_refresh(wayl);
|
if (wayl->pointer.pending_terminal != NULL) {
|
||||||
|
render_xcursor_update(wayl, wayl->pointer.pending_terminal);
|
||||||
|
wayl->pointer.pending_terminal = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
|
fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
|
||||||
{
|
{
|
||||||
struct renderer *renderer = data;
|
struct renderer *renderer = data;
|
||||||
|
struct wayland *wayl = renderer->wayl;
|
||||||
|
|
||||||
tll_foreach(renderer->wayl->terms, it) {
|
tll_foreach(renderer->wayl->terms, it) {
|
||||||
struct terminal *term = it->item;
|
struct terminal *term = it->item;
|
||||||
|
|
||||||
|
|
@ -1184,11 +1174,20 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
|
||||||
|
|
||||||
if (term->window->frame_callback == NULL)
|
if (term->window->frame_callback == NULL)
|
||||||
grid_render(term);
|
grid_render(term);
|
||||||
else
|
else {
|
||||||
|
/* Tells the frame callback to render again */
|
||||||
term->render.pending = true;
|
term->render.pending = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render_xcursor_refresh(renderer->wayl);
|
if (wayl->pointer.pending_terminal != NULL) {
|
||||||
|
if (wayl->pointer.xcursor_callback == NULL) {
|
||||||
|
render_xcursor_update(wayl, wayl->pointer.pending_terminal);
|
||||||
|
wayl->pointer.pending_terminal = NULL;
|
||||||
|
} else {
|
||||||
|
/* Frame callback will call render_xcursor_update() */
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue