diff options
Diffstat (limited to 'swt.c')
| -rw-r--r-- | swt.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -267,6 +267,19 @@ void wdrawline(Line line, int x1, int y1, int x2) { win.fontcache->box.height, colors[line[x].bg] ); + + if (line[x].mode & ATTR_UNDERLINE) { + fprintf(stderr, "DRAWING %c\n", line[x].u); + draw_rect( + win.canvas, + borderpx + x * win.fontcache->box.width, + borderpx + (y1 + 1) * win.fontcache->box.height - 1, + win.fontcache->box.width - 2, + 1, + colors[line[x].fg] + ); + } + draw_char( win.canvas, win.fontcache, @@ -639,6 +652,7 @@ handle_keyboard_event() void pointer_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y) { + wl_pointer_set_cursor(client.pointer.pointer, serial, client.pointer.surface, client.pointer.image->hotspot_x, client.pointer.image->hotspot_y); } @@ -651,6 +665,7 @@ pointer_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl void pointer_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t x, wl_fixed_t y) { + wl_surface_commit(client.pointer.surface); } @@ -692,6 +707,14 @@ setup() xdg_toplevel_add_listener(win.surface.toplevel, &toplevel_listener, &win); xdg_toplevel_set_title(win.surface.toplevel, "swt"); wl_surface_commit(win.surface.wl); + + client.pointer.theme = wl_cursor_theme_load(0, 24, client.shm); + client.pointer.cursor = wl_cursor_theme_get_cursor(client.pointer.theme, "text"); + client.pointer.image = client.pointer.cursor->images[0]; + client.pointer.buffer = wl_cursor_image_get_buffer(client.pointer.image); + client.pointer.surface = wl_compositor_create_surface(client.compositor); + wl_surface_attach(client.pointer.surface, client.pointer.buffer, 0, 0); + wl_surface_commit(client.pointer.surface); } |