aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-10-17 19:20:14 -0400
committerJack Jamison <jackqjamison@gmail.com>2025-10-17 19:20:14 -0400
commit90123fe5eb84061f9756d38bc6a5c8775798309b (patch)
treef277b15a00809224cffba49c3a394fa25423ab0d
parent1228252e6bc4f18664725d60413896e6d9d9a6c5 (diff)
better offset
-rw-r--r--README.md6
-rw-r--r--graphics.c4
-rw-r--r--keyboard.c4
3 files changed, 12 insertions, 2 deletions
diff --git a/README.md b/README.md
index ebbd698..0ee86d1 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,9 @@
# SWENU - Simple Wayland ENU
To build: `make`
+
+
+## Todo -
+- [ ] "Selection"
+- [ ] Output results and exit code
+- [ ] Scrolling
diff --git a/graphics.c b/graphics.c
index f9ce27e..f9695ba 100644
--- a/graphics.c
+++ b/graphics.c
@@ -148,7 +148,7 @@ void render_frame(client_state *state) {
glDrawElements(GL_TRIANGLES, state->input_buffer_grafix.num_elements, GL_UNSIGNED_INT, 0);
// shift pen
if (state->lines > 0) pen_y -= state->line_height;
- else pen_x += state->input_buffer_grafix.pixel_len;
+ else pen_x = state->width / 3.0f;
// draw options
array_for_all(item_t, item, state->items) {
@@ -158,7 +158,7 @@ void render_frame(client_state *state) {
// shift pen
if (state->lines > 0) pen_y -= state->line_height;
- else pen_x += item->pixel_len;
+ else pen_x += item->pixel_len + (state->line_height / 2.0f);
}
// present screen
diff --git a/keyboard.c b/keyboard.c
index 30a4859..bdfda16 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -69,6 +69,10 @@ void wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard,
void wl_keyboard_leave(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface) {
+ client_state *state = data;
+
+ // close on focus lost
+ state->running = false;
}
void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard,