New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xwayland: add drag'n'drop support #760

Merged
merged 26 commits into from Apr 5, 2018

Conversation

Projects
None yet
3 participants
@emersion
Member

emersion commented Mar 27, 2018

  • Add outgoing drag'n'drop support

  • Fixes incr transfers (for big files)

  • Refactor selection code

  • Wayland → Xwayland

    • Create DND window
    • Send DND_ENTER
    • Send DND_POSITION
    • Send DND_DROP
    • Receive DND_STATUS
    • Send DND_LEAVE
    • Receive DND_FINISHED
    • Redesign wlr_data_source
    • Fix Firefox refusing text
    • Fix Chromium crashing in non-incr transfer: support multiple transfers at the same time
    • Only allow one transfer at a time
    • Cleanup wlr_xwm_selection_transfer when transfer is finished
    • Fix incr transfers
      • Big picture from epiphany to gimp
      • Big picture from chromium to lowriter
    • Make sure I didn't broke clipboard stuff

Will be done in another PR:

  • Xwayland → Wayland
    • Figure out how the client knows about the Wayland window position: just draw a window that spans the whole screen
    • Figure out how to map X11 protocol to Wayland protocol
    • Receive DND_ENTER
    • Receive DND_POSITION
    • Receive DND_DROP
    • Send DND_STATUS
    • Receive DND_LEAVE
    • Send DND_FINISHED

Test clients:

  • Firefox
  • GTK+ (nice visual feedback)
  • Chromium
  • Gimp (has visual feedback too)

Fixes #295

@emersion emersion added the hackathon label Mar 27, 2018

@SirCmpwn

This comment has been minimized.

Show comment
Hide comment
@SirCmpwn

SirCmpwn Mar 27, 2018

Member

Build failed

Member

SirCmpwn commented Mar 27, 2018

Build failed

@SirCmpwn

This comment has been minimized.

Show comment
Hide comment
@SirCmpwn

SirCmpwn Mar 27, 2018

Member

FYI

Member

SirCmpwn commented Mar 27, 2018

FYI

@SirCmpwn

This comment has been minimized.

Show comment
Hide comment
@SirCmpwn

SirCmpwn Mar 27, 2018

Member

In case you were unaware

Member

SirCmpwn commented Mar 27, 2018

In case you were unaware

emersion added some commits Mar 28, 2018

xwayland: support multiple wayland → xwayland selection transfers
This fixes drag'n'drop support for Chromium.
Show outdated Hide outdated xwayland/xwm.c Outdated

emersion added some commits Apr 3, 2018

@emersion

This comment has been minimized.

Show comment
Hide comment
@emersion

emersion Apr 3, 2018

Member

Is it possible to get this reviewed? I'll open an issue about the remaining Firefox issue.

Member

emersion commented Apr 3, 2018

Is it possible to get this reviewed? I'll open an issue about the remaining Firefox issue.

@emersion emersion changed the title from [WIP] xwayland: add drag'n'drop support to xwayland: add drag'n'drop support Apr 3, 2018

}
xwm_dnd_send_event(xwm, xwm->atoms[DND_FINISHED], &data);
}*/

This comment has been minimized.

@SirCmpwn
@SirCmpwn

SirCmpwn Apr 3, 2018

Member

?

@SirCmpwn

This comment has been minimized.

Show comment
Hide comment
@SirCmpwn

SirCmpwn Apr 3, 2018

Member

LGTM but I can't test it until mods are fixed on the X11 backend

Member

SirCmpwn commented Apr 3, 2018

LGTM but I can't test it until mods are fixed on the X11 backend

@emersion

This comment has been minimized.

Show comment
Hide comment
@emersion

emersion Apr 3, 2018

Member

LGTM but I can't test it until mods are fixed on the X11 backend

Merged the fix

Member

emersion commented Apr 3, 2018

LGTM but I can't test it until mods are fixed on the X11 backend

Merged the fix

@SirCmpwn

This comment has been minimized.

Show comment
Hide comment
@SirCmpwn

SirCmpwn Apr 5, 2018

Member

Dragging image from epiphany to gimp (worked the first couple of times)

(gdb) bt
#0  0x00007f6d3abf2123 in wl_list_insert () at /usr/lib/libwayland-server.so.0
#1  0x00007f6d3ae55b8d in wlr_signal_emit_safe (signal=0x55cbcd46b7e0, data=0x55cbcd46b7a0)
    at ../util/signal.c:27
#2  0x00007f6d3ae382af in wlr_data_source_finish (source=0x55cbcd46b7a0)
    at ../types/wlr_data_device.c:1057
#3  0x00007f6d3ae38202 in data_source_resource_handle_destroy (resource=0x55cbcd46b830)
    at ../types/wlr_data_device.c:1038
#4  0x00007f6d3abedc12 in  () at /usr/lib/libwayland-server.so.0
#5  0x00007f6d3abf2619 in  () at /usr/lib/libwayland-server.so.0
#6  0x00007f6d3abedcff in wl_client_destroy () at /usr/lib/libwayland-server.so.0
#7  0x00007f6d3abeddb9 in  () at /usr/lib/libwayland-server.so.0
#8  0x00007f6d3abef9b2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#9  0x00007f6d3abee14c in wl_display_run () at /usr/lib/libwayland-server.so.0
#10 0x000055cbcbfa53d1 in main (argc=1, argv=0x7ffd174b4c18) at ../rootston/main.c:81
Member

SirCmpwn commented Apr 5, 2018

Dragging image from epiphany to gimp (worked the first couple of times)

(gdb) bt
#0  0x00007f6d3abf2123 in wl_list_insert () at /usr/lib/libwayland-server.so.0
#1  0x00007f6d3ae55b8d in wlr_signal_emit_safe (signal=0x55cbcd46b7e0, data=0x55cbcd46b7a0)
    at ../util/signal.c:27
#2  0x00007f6d3ae382af in wlr_data_source_finish (source=0x55cbcd46b7a0)
    at ../types/wlr_data_device.c:1057
#3  0x00007f6d3ae38202 in data_source_resource_handle_destroy (resource=0x55cbcd46b830)
    at ../types/wlr_data_device.c:1038
#4  0x00007f6d3abedc12 in  () at /usr/lib/libwayland-server.so.0
#5  0x00007f6d3abf2619 in  () at /usr/lib/libwayland-server.so.0
#6  0x00007f6d3abedcff in wl_client_destroy () at /usr/lib/libwayland-server.so.0
#7  0x00007f6d3abeddb9 in  () at /usr/lib/libwayland-server.so.0
#8  0x00007f6d3abef9b2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#9  0x00007f6d3abee14c in wl_display_run () at /usr/lib/libwayland-server.so.0
#10 0x000055cbcbfa53d1 in main (argc=1, argv=0x7ffd174b4c18) at ../rootston/main.c:81
@SirCmpwn

This comment has been minimized.

Show comment
Hide comment
@SirCmpwn

SirCmpwn Apr 5, 2018

Member

Cannot reproduce that segfault after merging in master. I think this is good to merge.

Member

SirCmpwn commented Apr 5, 2018

Cannot reproduce that segfault after merging in master. I think this is good to merge.

@SirCmpwn SirCmpwn merged commit 89138e5 into swaywm:master Apr 5, 2018

1 check passed

builds.sr.ht builds.sr.ht job completed successfully
Details

@emersion emersion deleted the emersion:xwayland-dnd branch Apr 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment