summaryrefslogtreecommitdiff
path: root/src/entry.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2021-11-15 00:08:23 +0000
committerPhil Jones <philj56@gmail.com>2021-11-15 00:08:23 +0000
commit108df42e561b7e81ba09a8c278a562129e651bb6 (patch)
tree496e10b768ea44addfc403fb1634ccc2d7be62b9 /src/entry.h
parentd65bdf025f9685f3b332aefffe6f8b5c8dbe8827 (diff)
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.
Diffstat (limited to 'src/entry.h')
-rw-r--r--src/entry.h7
1 files changed, 2 insertions, 5 deletions
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);