aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-17 20:51:31 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-17 20:51:31 +0000
commit34f89fbe72ca3cb99ca8d92ee2bf6ded29d27788 (patch)
treed0d20c11b5fc3439b86f1b1d48ca139587d38a61 /search.c
parentcsi: ‘CSI 13 ; 2 t’ reply is now (0,0) (diff)
parentwayland: csd_instantiate(): remove TODO (diff)
Merge branch 'refactor-subsurface-creation'
Diffstat (limited to 'search.c')
-rw-r--r--search.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/search.c b/search.c
index d7939219..5dfa7b58 100644
--- a/search.c
+++ b/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);
free(term->search.buf);
term->search.buf = NULL;
@@ -124,14 +118,8 @@ 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);
+ xassert(ret);
term->search.original_view = term->grid->view;
term->search.view_followed_offset = term->grid->view == term->grid->offset;