diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-09-23 07:18:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-23 07:18:09 -0500 |
commit | 0bc9dc192fb453fad5ce9dae519786a4989fb36a (patch) | |
tree | 885181393381b501cd20da0fa026558defb484bd | |
parent | Merge pull request #2695 from RyanDwyer/remove-moveoutoftabsstacks (diff) | |
parent | Fix GtkMenuBar always opening first item (diff) | |
download | sway-0bc9dc192fb453fad5ce9dae519786a4989fb36a.tar.gz sway-0bc9dc192fb453fad5ce9dae519786a4989fb36a.tar.zst sway-0bc9dc192fb453fad5ce9dae519786a4989fb36a.zip |
Merge pull request #2696 from RyanDwyer/fix-gtkmenubar
Fix GtkMenuBar always opening first item
-rw-r--r-- | sway/input/seat.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 49fe46ba..a9c564e7 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -348,17 +348,33 @@ struct sway_seat *seat_create(struct sway_input_manager *input, | |||
348 | seat->input = input; | 348 | seat->input = input; |
349 | wl_list_init(&seat->devices); | 349 | wl_list_init(&seat->devices); |
350 | 350 | ||
351 | wlr_seat_set_capabilities(seat->wlr_seat, | ||
352 | WL_SEAT_CAPABILITY_KEYBOARD | | ||
353 | WL_SEAT_CAPABILITY_POINTER | | ||
354 | WL_SEAT_CAPABILITY_TOUCH); | ||
355 | |||
356 | |||
357 | wl_list_insert(&input->seats, &seat->link); | 351 | wl_list_insert(&input->seats, &seat->link); |
358 | 352 | ||
359 | return seat; | 353 | return seat; |
360 | } | 354 | } |
361 | 355 | ||
356 | static void seat_update_capabilities(struct sway_seat *seat) { | ||
357 | uint32_t caps = 0; | ||
358 | struct sway_seat_device *seat_device; | ||
359 | wl_list_for_each(seat_device, &seat->devices, link) { | ||
360 | switch (seat_device->input_device->wlr_device->type) { | ||
361 | case WLR_INPUT_DEVICE_KEYBOARD: | ||
362 | caps |= WL_SEAT_CAPABILITY_KEYBOARD; | ||
363 | break; | ||
364 | case WLR_INPUT_DEVICE_POINTER: | ||
365 | caps |= WL_SEAT_CAPABILITY_POINTER; | ||
366 | break; | ||
367 | case WLR_INPUT_DEVICE_TOUCH: | ||
368 | caps |= WL_SEAT_CAPABILITY_TOUCH; | ||
369 | break; | ||
370 | case WLR_INPUT_DEVICE_TABLET_TOOL: | ||
371 | case WLR_INPUT_DEVICE_TABLET_PAD: | ||
372 | break; | ||
373 | } | ||
374 | } | ||
375 | wlr_seat_set_capabilities(seat->wlr_seat, caps); | ||
376 | } | ||
377 | |||
362 | static void seat_apply_input_config(struct sway_seat *seat, | 378 | static void seat_apply_input_config(struct sway_seat *seat, |
363 | struct sway_seat_device *sway_device) { | 379 | struct sway_seat_device *sway_device) { |
364 | const char *mapped_to_output = NULL; | 380 | const char *mapped_to_output = NULL; |
@@ -489,6 +505,8 @@ void seat_add_device(struct sway_seat *seat, | |||
489 | wl_list_insert(&seat->devices, &seat_device->link); | 505 | wl_list_insert(&seat->devices, &seat_device->link); |
490 | 506 | ||
491 | seat_configure_device(seat, input_device); | 507 | seat_configure_device(seat, input_device); |
508 | |||
509 | seat_update_capabilities(seat); | ||
492 | } | 510 | } |
493 | 511 | ||
494 | void seat_remove_device(struct sway_seat *seat, | 512 | void seat_remove_device(struct sway_seat *seat, |
@@ -503,6 +521,8 @@ void seat_remove_device(struct sway_seat *seat, | |||
503 | input_device->identifier, seat->wlr_seat->name); | 521 | input_device->identifier, seat->wlr_seat->name); |
504 | 522 | ||
505 | seat_device_destroy(seat_device); | 523 | seat_device_destroy(seat_device); |
524 | |||
525 | seat_update_capabilities(seat); | ||
506 | } | 526 | } |
507 | 527 | ||
508 | void seat_configure_xcursor(struct sway_seat *seat) { | 528 | void seat_configure_xcursor(struct sway_seat *seat) { |