mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-13 05:33:51 -04:00
search: use wayl_win_subsurface_new/destroy()
This commit is contained in:
parent
587f04f2e1
commit
e049124f6d
5 changed files with 20 additions and 34 deletions
19
search.c
19
search.c
|
|
@ -81,13 +81,7 @@ static void
|
|||
search_cancel_keep_selection(struct terminal *term)
|
||||
{
|
||||
struct wl_window *win = term->window;
|
||||
if (win->search_sub_surface != NULL)
|
||||
wl_subsurface_destroy(win->search_sub_surface);
|
||||
if (win->search_surface != NULL)
|
||||
wl_surface_destroy(win->search_surface);
|
||||
|
||||
win->search_surface = NULL;
|
||||
win->search_sub_surface = NULL;
|
||||
wayl_win_subsurface_destroy(&win->search_surface);
|
||||
|
||||
free(term->search.buf);
|
||||
term->search.buf = NULL;
|
||||
|
|
@ -124,14 +118,9 @@ search_begin(struct terminal *term)
|
|||
}
|
||||
|
||||
/* On-demand instantiate wayland surface */
|
||||
struct wl_window *win = term->window;
|
||||
struct wayland *wayl = term->wl;
|
||||
win->search_surface = wl_compositor_create_surface(wayl->compositor);
|
||||
wl_surface_set_user_data(win->search_surface, term->window);
|
||||
|
||||
win->search_sub_surface = wl_subcompositor_get_subsurface(
|
||||
wayl->sub_compositor, win->search_surface, win->surface);
|
||||
wl_subsurface_set_sync(win->search_sub_surface);
|
||||
bool ret = wayl_win_subsurface_new(
|
||||
term->window, &term->window->search_surface);
|
||||
xassert(ret);
|
||||
|
||||
term->search.original_view = term->grid->view;
|
||||
term->search.view_followed_offset = term->grid->view == term->grid->offset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue