aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-17 20:03:26 -0500
committerGitHub <noreply@github.com>2017-12-17 20:03:26 -0500
commit10c72f4bf6202bfce89e5a40b03475dd28cd68df (patch)
tree3c13e6a58f51e920e60ad57c033307eddca1fe23 /include/wlr
parent3363ea869a250a54214af93d6fc7cdc22f1fad9e (diff)
parent804c7a73a6d7af18e202109d331d1208af7f57d4 (diff)
Merge pull request #487 from emersion/xwm-selection
xwm clipboard sync, 2nd edition
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/xwayland.h5
-rw-r--r--include/wlr/xwm.h30
2 files changed, 35 insertions, 0 deletions
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h
index 468437bc..acf04595 100644
--- a/include/wlr/xwayland.h
+++ b/include/wlr/xwayland.h
@@ -4,6 +4,7 @@
#include <time.h>
#include <stdbool.h>
#include <wlr/types/wlr_compositor.h>
+#include <wlr/types/wlr_seat.h>
#include <xcb/xcb.h>
#ifdef HAS_XCB_ICCCM
@@ -20,6 +21,7 @@ struct wlr_xwayland {
struct wl_client *client;
struct wl_display *wl_display;
struct wlr_compositor *compositor;
+ struct wlr_seat *seat;
time_t server_start;
struct wl_event_source *sigusr1_source;
@@ -175,4 +177,7 @@ void wlr_xwayland_surface_set_maximized(struct wlr_xwayland_surface *surface,
void wlr_xwayland_surface_set_fullscreen(struct wlr_xwayland_surface *surface,
bool fullscreen);
+void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland,
+ struct wlr_seat *seat);
+
#endif
diff --git a/include/wlr/xwm.h b/include/wlr/xwm.h
index c350b6e2..47e674c0 100644
--- a/include/wlr/xwm.h
+++ b/include/wlr/xwm.h
@@ -31,6 +31,13 @@ enum atom_name {
_NET_WM_STATE_MAXIMIZED_VERT,
_NET_WM_STATE_MAXIMIZED_HORZ,
WM_STATE,
+ CLIPBOARD,
+ WL_SELECTION,
+ TARGETS,
+ CLIPBOARD_MANAGER,
+ INCR,
+ TEXT,
+ TIMESTAMP,
ATOM_LAST,
};
@@ -45,6 +52,7 @@ enum net_wm_state_action {
struct wlr_xwm {
struct wlr_xwayland *xwayland;
struct wl_event_source *event_source;
+ struct wlr_seat *seat;
xcb_atom_t atoms[ATOM_LAST];
xcb_connection_t *xcb_conn;
@@ -55,6 +63,21 @@ struct wlr_xwm {
xcb_render_pictformat_t render_format_id;
xcb_cursor_t cursor;
+ // selection properties
+ xcb_window_t selection_window;
+ xcb_selection_request_event_t selection_request;
+ xcb_window_t selection_owner;
+ xcb_timestamp_t selection_timestamp;
+ int incr;
+ int data_source_fd;
+ int property_start;
+ xcb_get_property_reply_t *property_reply;
+ struct wl_event_source *property_source;
+ int flush_property_on_delete;
+ struct wl_array source_data;
+ xcb_atom_t selection_target;
+ bool selection_property_set;
+
struct wlr_xwayland_surface *focus_surface;
struct wl_list surfaces; // wlr_xwayland_surface::link
@@ -63,6 +86,7 @@ struct wlr_xwm {
const xcb_query_extension_reply_t *xfixes;
struct wl_listener compositor_surface_create;
+ struct wl_listener seat_selection_change;
};
struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland);
@@ -72,4 +96,10 @@ void xwm_destroy(struct wlr_xwm *xwm);
void xwm_set_cursor(struct wlr_xwm *xwm, const uint8_t *pixels, uint32_t stride,
uint32_t width, uint32_t height, int32_t hotspot_x, int32_t hotspot_y);
+int xwm_handle_selection_event(struct wlr_xwm *xwm, xcb_generic_event_t *event);
+
+void xwm_selection_init(struct wlr_xwm *xwm);
+
+void xwm_set_seat(struct wlr_xwm *xwm, struct wlr_seat *seat);
+
#endif