aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-18 14:05:51 -0400
committerGitHub <noreply@github.com>2017-08-18 14:05:51 -0400
commita1551bccc05caeb77ee7ce5e4151de964f29f444 (patch)
tree44f96d69d6d9c16645c1e28b5d1b937fc4e93aa1 /examples
parent7d3f66eaa0aa48a1e1c289f33b6f0d1fdd29bcd5 (diff)
parentf2a90986919febd6d6a47e044ca7f1842980c5e9 (diff)
Merge pull request #107 from nyorain/wlr_data_device_manager
Implement wlr_data_{source,device,device_manager}
Diffstat (limited to 'examples')
-rw-r--r--examples/compositor/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/compositor/main.c b/examples/compositor/main.c
index 1fe81046..751a3f23 100644
--- a/examples/compositor/main.c
+++ b/examples/compositor/main.c
@@ -17,6 +17,7 @@
#include <wlr/types/wlr_wl_shell.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_data_device_manager.h>
#include <xkbcommon/xkbcommon.h>
#include <wlr/util/log.h>
#include "shared.h"
@@ -31,6 +32,7 @@ struct sample_state {
struct wlr_wl_shell *wl_shell;
struct wlr_seat *wl_seat;
struct wlr_xdg_shell_v6 *xdg_shell;
+ struct wlr_data_device_manager *data_device_manager;
struct wl_resource *focus;
struct wl_listener keyboard_bound;
int keymap_fd;
@@ -130,6 +132,10 @@ static void handle_keyboard_bound(struct wl_listener *listener, void *data) {
wl_keyboard_send_keymap(handle->keyboard, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
state->keymap_fd, state->keymap_size);
+
+ if (wl_resource_get_version(handle->keyboard) >= 2) {
+ wl_keyboard_send_repeat_info(handle->keyboard, 25, 600);
+ }
}
int main() {
@@ -150,6 +156,7 @@ int main() {
wl_compositor_init(compositor.display, &state.compositor, state.renderer);
state.wl_shell = wlr_wl_shell_create(compositor.display);
state.xdg_shell = wlr_xdg_shell_v6_create(compositor.display);
+ state.data_device_manager = wlr_data_device_manager_create(compositor.display);
state.wl_seat = wlr_seat_create(compositor.display, "seat0");
state.keyboard_bound.notify = handle_keyboard_bound;