aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 13:59:04 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 15:01:09 -0500
commit609f63934ab3eb925741450aa7f78db1c11bdd37 (patch)
treedec4a8477166fda0557589fdeec5a30a2ccc025a /sway/input/seat.c
parentremove pointer device (diff)
downloadsway-609f63934ab3eb925741450aa7f78db1c11bdd37.tar.gz
sway-609f63934ab3eb925741450aa7f78db1c11bdd37.tar.zst
sway-609f63934ab3eb925741450aa7f78db1c11bdd37.zip
basic keyboard
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index b3d36681..0a5329c8 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -4,6 +4,7 @@
4#include "sway/input/seat.h" 4#include "sway/input/seat.h"
5#include "sway/input/cursor.h" 5#include "sway/input/cursor.h"
6#include "sway/input/input-manager.h" 6#include "sway/input/input-manager.h"
7#include "sway/input/keyboard.h"
7#include "sway/output.h" 8#include "sway/output.h"
8#include "sway/view.h" 9#include "sway/view.h"
9#include "log.h" 10#include "log.h"
@@ -36,6 +37,8 @@ struct sway_seat *sway_seat_create(struct sway_input_manager *input,
36 37
37 sway_seat_configure_xcursor(seat); 38 sway_seat_configure_xcursor(seat);
38 39
40 wl_list_init(&seat->keyboards);
41
39 return seat; 42 return seat;
40} 43}
41 44
@@ -45,6 +48,13 @@ static void seat_add_pointer(struct sway_seat *seat,
45 wlr_cursor_attach_input_device(seat->cursor->cursor, device); 48 wlr_cursor_attach_input_device(seat->cursor->cursor, device);
46} 49}
47 50
51static void seat_add_keyboard(struct sway_seat *seat,
52 struct wlr_input_device *device) {
53 struct sway_keyboard *keyboard = sway_keyboard_create(seat, device);
54 wl_list_insert(&seat->keyboards, &keyboard->link);
55 wlr_seat_set_keyboard(seat->seat, device);
56}
57
48void sway_seat_add_device(struct sway_seat *seat, 58void sway_seat_add_device(struct sway_seat *seat,
49 struct wlr_input_device *device) { 59 struct wlr_input_device *device) {
50 sway_log(L_DEBUG, "input add: %s", device->name); 60 sway_log(L_DEBUG, "input add: %s", device->name);
@@ -53,6 +63,8 @@ void sway_seat_add_device(struct sway_seat *seat,
53 seat_add_pointer(seat, device); 63 seat_add_pointer(seat, device);
54 break; 64 break;
55 case WLR_INPUT_DEVICE_KEYBOARD: 65 case WLR_INPUT_DEVICE_KEYBOARD:
66 seat_add_keyboard(seat, device);
67 break;
56 case WLR_INPUT_DEVICE_TOUCH: 68 case WLR_INPUT_DEVICE_TOUCH:
57 case WLR_INPUT_DEVICE_TABLET_PAD: 69 case WLR_INPUT_DEVICE_TABLET_PAD:
58 case WLR_INPUT_DEVICE_TABLET_TOOL: 70 case WLR_INPUT_DEVICE_TABLET_TOOL:
@@ -138,7 +150,7 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) {
138 view->iface.set_activated(view, true); 150 view->iface.set_activated(view, true);
139 wl_signal_add(&container->events.destroy, &seat->focus_destroy); 151 wl_signal_add(&container->events.destroy, &seat->focus_destroy);
140 seat->focus_destroy.notify = handle_focus_destroy; 152 seat->focus_destroy.notify = handle_focus_destroy;
141 // TODO give keyboard focus 153 wlr_seat_keyboard_notify_enter(seat->seat, view->surface);
142 } 154 }
143 155
144 seat->focus = container; 156 seat->focus = container;