From 108df42e561b7e81ba09a8c278a562129e651bb6 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Mon, 15 Nov 2021 00:08:23 +0000 Subject: Switch from subsurface setup to just one surface. The subsurface was playing havoc with layer shell stuff, and I don't think any potential efficiency gain is worth the complicated code to work out how big the subsurface should be. Instead, the entry code now just draws directly onto the main surface. Damage information should be passed to glTexSubImage2D() in future, to avoid redrawing the entire window every keypress. --- src/entry.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/entry.h') diff --git a/src/entry.h b/src/entry.h index 0f22cf4..a362ec9 100644 --- a/src/entry.h +++ b/src/entry.h @@ -7,11 +7,9 @@ #include "surface.h" #include "string_vec.h" -#define MAX_INPUT_LENGTH 64 +#define MAX_INPUT_LENGTH 128 struct entry { - struct surface surface; - struct wl_subsurface *wl_subsurface; struct image image; struct { PangoContext *context; @@ -22,7 +20,6 @@ struct entry { cairo_surface_t *surface; cairo_t *cr; } cairo; - PangoRectangle text_bounds; wchar_t input[MAX_INPUT_LENGTH]; /* Assume maximum of 4 bytes per wchar_t (for UTF-8) */ @@ -49,7 +46,7 @@ struct entry { } border; }; -void entry_init(struct entry *entry, uint32_t scale); +void entry_init(struct entry *entry, uint32_t width, uint32_t height, uint32_t scale); void entry_destroy(struct entry *entry); void entry_update(struct entry *entry); void entry_set_scale(struct entry *entry, uint32_t scale); -- cgit v1.2.3