aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-03-28 17:26:29 -0400
committeremersion <contact@emersion.fr>2018-03-28 17:32:52 -0400
commit3effe153bce7c7819586b619d0d575e9238ad124 (patch)
tree261970cc67412cca416d7d1927c8ccad9972b844 /xwayland
parent30babb38656e53b159c8be13d6380104e108c8fb (diff)
xwayland: make wayland → xwayland work
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/selection.c27
-rw-r--r--xwayland/xwm.c3
2 files changed, 21 insertions, 9 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 976b9200..740fac73 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -24,7 +24,7 @@ static xcb_atom_t data_device_manager_dnd_action_to_atom(
return XCB_ATOM_NONE;
}
-/*static enum wl_data_device_manager_dnd_action
+static enum wl_data_device_manager_dnd_action
data_device_manager_dnd_action_from_atom(struct wlr_xwm *xwm,
enum atom_name atom) {
if (atom == xwm->atoms[DND_ACTION_COPY] ||
@@ -36,7 +36,7 @@ static xcb_atom_t data_device_manager_dnd_action_to_atom(
return WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK;
}
return WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE;
-}*/
+}
static void xwm_selection_send_notify(struct wlr_xwm_selection *selection,
xcb_atom_t property) {
@@ -963,15 +963,25 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm,
if (ev->type == xwm->atoms[DND_STATUS]) {
struct wlr_drag *drag = xwm->drag;
if (drag == NULL) {
- return 0;
+ wlr_log(L_DEBUG, "Ignoring XdndStatus client message because "
+ "there's no current drag");
+ return 1;
}
- // xcb_client_message_data_t *data = &ev->data;
- // xcb_window_t target_window = data->data32[0];
- // bool accepted = data->data32[1] & 1;
- // xcb_atom_t action = data->data32[4];
+ xcb_client_message_data_t *data = &ev->data;
+ xcb_window_t target_window = data->data32[0];
+ bool accepted = data->data32[1] & 1;
+ xcb_atom_t action_atom = data->data32[4];
+
+ enum wl_data_device_manager_dnd_action action =
+ data_device_manager_dnd_action_from_atom(xwm, action_atom);
+
+ drag->source->accepted = accepted;
+ drag->source->current_dnd_action = action;
- // TODO: drag->source->dnd_action(data_device_manager_dnd_action_from_atom(xwm, action))
+ // TODO: drag->source->dnd_action()
+ wlr_log(L_DEBUG, "DND_STATUS window=%d accepted=%d action=%d",
+ target_window, accepted, action);
return 1;
} else {
return 0;
@@ -1150,6 +1160,7 @@ static void seat_handle_drag_drop(struct wl_listener *listener, void *data) {
return; // No xwayland surface focused
}
+ wlr_log(L_DEBUG, "Wayland drag dropped over an Xwayland window");
xwm_dnd_send_drop(xwm, event->time);
}
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 4b55769e..f6668796 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -559,7 +559,8 @@ static void read_surface_property(struct wlr_xwm *xwm,
read_surface_motif_hints(xwm, xsurface, reply);
} else {
char *prop_name = get_atom_name(xwm, property);
- wlr_log(L_DEBUG, "unhandled x11 property %u (%s)", property, prop_name);
+ wlr_log(L_DEBUG, "unhandled X11 property %u (%s) for window %u",
+ property, prop_name, xsurface->window_id);
free(prop_name);
}