From 1e4b11b0fa73d4fa9e4f124fa04173f92f645d1f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 29 Aug 2019 20:22:07 +0200 Subject: search: don't destroy/recreate search (sub)surface Create the sub-surface once, at startup. Then, instead of destroying it when committing/cancelling a search, unmap it (by attaching a NULL buffer to it). --- main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 18e2a19a..a076fb24 100644 --- a/main.c +++ b/main.c @@ -723,6 +723,7 @@ main(int argc, char *const *argv) goto out; } + /* Main window */ term.wl.surface = wl_compositor_create_surface(term.wl.compositor); if (term.wl.surface == NULL) { LOG_ERR("failed to create wayland surface"); @@ -740,6 +741,12 @@ main(int argc, char *const *argv) xdg_toplevel_set_app_id(term.wl.xdg_toplevel, "foot"); term_set_window_title(&term, "foot"); + /* Scrollback search box */ + term.wl.search_surface = wl_compositor_create_surface(term.wl.compositor); + term.wl.search_sub_surface = wl_subcompositor_get_subsurface( + term.wl.sub_compositor, term.wl.search_surface, term.wl.surface); + wl_subsurface_set_desync(term.wl.search_sub_surface); + wl_surface_commit(term.wl.surface); wl_display_roundtrip(term.wl.display); -- cgit v1.3