summaryrefslogtreecommitdiff
path: root/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'image.c')
-rw-r--r--image.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/image.c b/image.c
index e38da0f..3f206fc 100644
--- a/image.c
+++ b/image.c
@@ -184,7 +184,7 @@ image_draw(struct image *image)
&rectangle,
image->surface);
- wl_compositor_commit(image->compositor, image->key);
+ window_commit(image->window, image->key);
}
static gboolean
@@ -217,6 +217,15 @@ resize_handler(struct window *window, void *data)
}
static void
+keyboard_focus_handler(struct window *window,
+ struct wl_input_device *device, void *data)
+{
+ struct image *image = data;
+
+ image_schedule_redraw(image);
+}
+
+static void
handle_acknowledge(void *data,
struct wl_compositor *compositor,
uint32_t key, uint32_t frame)
@@ -274,6 +283,7 @@ image_create(struct display *display, uint32_t key, const char *filename)
image->compositor = display_get_compositor(display);
window_set_resize_handler(image->window, resize_handler, image);
+ window_set_keyboard_focus_handler(image->window, keyboard_focus_handler, image);
wl_compositor_add_listener(image->compositor, &compositor_listener, image);