diff options
author | emersion <contact@emersion.fr> | 2018-12-09 16:36:36 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-24 12:15:18 +0100 |
commit | 0040f7089f3d12cc8457790a9bd24a556a6f5a75 (patch) | |
tree | 68a7204601ebb94269c17797a067624940d26e65 | |
parent | 1a2727cc3889677dd53000a95d70710578c74255 (diff) |
data-device: unexport wlr_seat_client_send_selection
-rw-r--r-- | include/types/wlr_data_device.h | 8 | ||||
-rw-r--r-- | include/wlr/types/wlr_data_device.h | 9 | ||||
-rw-r--r-- | types/data_device/wlr_data_device.c | 4 | ||||
-rw-r--r-- | types/seat/wlr_seat_keyboard.c | 11 |
4 files changed, 16 insertions, 16 deletions
diff --git a/include/types/wlr_data_device.h b/include/types/wlr_data_device.h index d2bdcc38..0f58cc29 100644 --- a/include/types/wlr_data_device.h +++ b/include/types/wlr_data_device.h @@ -33,5 +33,13 @@ struct wlr_seat_client *seat_client_from_data_device_resource( bool seat_client_start_drag(struct wlr_seat_client *client, struct wlr_data_source *source, struct wlr_surface *icon_surface, struct wlr_surface *origin, uint32_t serial); +/** + * Creates a new wl_data_offer if there is a wl_data_source currently set as + * the seat selection and sends it to the seat client, followed by the + * wl_data_device.selection() event. If there is no current selection, the + * wl_data_device.selection() event will carry a NULL wl_data_offer. If the + * client does not have a wl_data_device for the seat nothing will be done. + */ +void seat_client_send_selection(struct wlr_seat_client *seat_client); #endif diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h index 1d2451b9..5bf52599 100644 --- a/include/wlr/types/wlr_data_device.h +++ b/include/wlr/types/wlr_data_device.h @@ -157,15 +157,6 @@ struct wlr_data_device_manager *wlr_data_device_manager_create( void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager); /** - * Creates a new wl_data_offer if there is a wl_data_source currently set as - * the seat selection and sends it to the seat client, followed by the - * wl_data_device.selection() event. If there is no current selection, the - * wl_data_device.selection() event will carry a NULL wl_data_offer. If the - * client does not have a wl_data_device for the seat nothing * will be done. - */ -void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client); - -/** * Requests a selection to be set for the seat. */ void wlr_seat_request_set_selection(struct wlr_seat *seat, diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c index d3c0ed06..208d2f3e 100644 --- a/types/data_device/wlr_data_device.c +++ b/types/data_device/wlr_data_device.c @@ -113,7 +113,7 @@ static void device_resource_send_selection(struct wl_resource *device_resource) } } -void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client) { +void seat_client_send_selection(struct wlr_seat_client *seat_client) { struct wlr_data_source *source = seat_client->seat->selection_source; if (source != NULL) { source->accepted = false; @@ -174,7 +174,7 @@ void wlr_seat_set_selection(struct wlr_seat *seat, struct wlr_seat_client *focused_client = seat->keyboard_state.focused_client; if (focused_client) { - wlr_seat_client_send_selection(focused_client); + seat_client_send_selection(focused_client); } if (source) { diff --git a/types/seat/wlr_seat_keyboard.c b/types/seat/wlr_seat_keyboard.c index 96176b6d..c92103eb 100644 --- a/types/seat/wlr_seat_keyboard.c +++ b/types/seat/wlr_seat_keyboard.c @@ -2,17 +2,18 @@ #include <assert.h> #include <stdlib.h> #include <string.h> -#include <time.h> #include <sys/mman.h> +#include <time.h> #include <unistd.h> #include <wayland-server.h> #include <wlr/types/wlr_data_device.h> -#include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_gtk_primary_selection.h> +#include <wlr/types/wlr_input_device.h> #include <wlr/util/log.h> +#include "types/wlr_data_device.h" #include "types/wlr_seat.h" -#include "util/signal.h" #include "util/shm.h" +#include "util/signal.h" static void default_keyboard_enter(struct wlr_seat_keyboard_grab *grab, struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes, @@ -271,8 +272,6 @@ void wlr_seat_keyboard_enter(struct wlr_seat *seat, wl_keyboard_send_enter(resource, serial, surface->resource, &keys); } wl_array_release(&keys); - - wlr_seat_client_send_selection(client); } // reinitialize the focus destroy events @@ -292,6 +291,8 @@ void wlr_seat_keyboard_enter(struct wlr_seat *seat, // tell new client about any modifier change last, // as it targets seat->keyboard_state.focused_client wlr_seat_keyboard_send_modifiers(seat, modifiers); + + seat_client_send_selection(client); } struct wlr_seat_keyboard_focus_change_event event = { |