selection: add support for pasting *from* primary

This commit is contained in:
Daniel Eklöf 2019-07-11 17:02:21 +02:00
parent e56066feef
commit 703aeecb95
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 124 additions and 6 deletions

View file

@ -8,9 +8,11 @@
#include <cairo.h>
#include <wayland-client.h>
#include <primary-selection-unstable-v1.h>
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-keysyms.h>
#include "tllist.h"
#define likely(c) __builtin_expect(!!(c), 1)
@ -25,6 +27,8 @@ struct wayland {
struct wl_seat *seat;
struct wl_data_device_manager *data_device_manager;
struct wl_data_device *data_device;
struct zwp_primary_selection_device_manager_v1 *primary_selection_device_manager;
struct zwp_primary_selection_device_v1 *primary_selection_device;
struct wl_keyboard *keyboard;
struct {
struct wl_pointer *pointer;
@ -193,6 +197,13 @@ struct clipboard {
uint32_t serial;
};
struct primary {
struct zwp_primary_selection_source_v1 *data_source;
struct zwp_primary_selection_offer_v1 *data_offer;
char *text;
uint32_t serial;
};
struct terminal {
pid_t slave;
int ptmx;
@ -240,8 +251,8 @@ struct terminal {
struct {
struct coord start;
struct coord end;
struct clipboard primary;
struct clipboard clipboard;
struct primary primary;
} selection;
struct grid normal;