mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-28 08:56:32 -05:00
xwayland/selection: make xwm_selection_init take a wlr_xwm_selection *
This makes it consistent with xwm_selection_finish.
This commit is contained in:
parent
b3d782f818
commit
dd4c8aa45e
3 changed files with 55 additions and 57 deletions
|
|
@ -1927,7 +1927,57 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *xwayland, int wm_fd) {
|
|||
|
||||
xwm_set_net_active_window(xwm, XCB_WINDOW_NONE);
|
||||
|
||||
xwm_selection_init(xwm);
|
||||
// Clipboard and primary selection
|
||||
xwm->selection_window = xcb_generate_id(xwm->xcb_conn);
|
||||
xcb_create_window(
|
||||
xwm->xcb_conn,
|
||||
XCB_COPY_FROM_PARENT,
|
||||
xwm->selection_window,
|
||||
xwm->screen->root,
|
||||
0, 0,
|
||||
10, 10,
|
||||
0,
|
||||
XCB_WINDOW_CLASS_INPUT_OUTPUT,
|
||||
xwm->screen->root_visual,
|
||||
XCB_CW_EVENT_MASK, (uint32_t[]){
|
||||
XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE
|
||||
}
|
||||
);
|
||||
|
||||
xcb_set_selection_owner(xwm->xcb_conn, xwm->selection_window,
|
||||
xwm->atoms[CLIPBOARD_MANAGER], XCB_TIME_CURRENT_TIME);
|
||||
|
||||
xwm_selection_init(&xwm->clipboard_selection, xwm, xwm->atoms[CLIPBOARD]);
|
||||
xwm_selection_init(&xwm->primary_selection, xwm, xwm->atoms[PRIMARY]);
|
||||
|
||||
// Drag'n'drop
|
||||
xwm->dnd_window = xcb_generate_id(xwm->xcb_conn);
|
||||
xcb_create_window(
|
||||
xwm->xcb_conn,
|
||||
XCB_COPY_FROM_PARENT,
|
||||
xwm->dnd_window,
|
||||
xwm->screen->root,
|
||||
0, 0,
|
||||
8192, 8192,
|
||||
0,
|
||||
XCB_WINDOW_CLASS_INPUT_ONLY,
|
||||
xwm->screen->root_visual,
|
||||
XCB_CW_EVENT_MASK, (uint32_t[]){
|
||||
XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE
|
||||
}
|
||||
);
|
||||
|
||||
xcb_change_property(
|
||||
xwm->xcb_conn,
|
||||
XCB_PROP_MODE_REPLACE,
|
||||
xwm->dnd_window,
|
||||
xwm->atoms[DND_AWARE],
|
||||
XCB_ATOM_ATOM,
|
||||
32, // format
|
||||
1, &(uint32_t){XDND_VERSION}
|
||||
);
|
||||
|
||||
xwm_selection_init(&xwm->dnd_selection, xwm, xwm->atoms[DND_SELECTION]);
|
||||
|
||||
xwm->compositor_new_surface.notify = handle_compositor_new_surface;
|
||||
wl_signal_add(&xwayland->compositor->events.new_surface,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue