[xwl] text/x-uri converter for selected X url list format targets
ClosedPublic

Authored by romangg on Sep 20 2018, 9:58 PM.

Details

Summary

On X several target atoms are established to provide data similar to the
text/uri-list target format (the respective MIME on Wayland is called
text/x-uri).

Firefox can send link data in the NETSCAPE_URL format ones. Chromium on the
other side sends link data in the text/x-moz-url format, which transports
UTF-16 text.

For both these peculiarities this patch provides converter functions, that
translate these formats into the Wayland native text/x-uri format. In the
other direction no translation is necessary. Both browsers supports the
text/uri-list format when receiving link lists.

Test Plan

Manually with Firefox and Chromium.

Diff Detail

Repository
R108 KWin
Branch
0uriConvertXwl
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6557
Build 6575: arc lint + arc unit
romangg created this revision.Sep 20 2018, 9:58 PM
Restricted Application added a project: KWin. · View Herald TranscriptSep 20 2018, 9:58 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Sep 20 2018, 9:58 PM
romangg updated this revision to Diff 48529.Jan 2 2019, 12:46 PM

Rebase on master/changes.

zzag added a subscriber: zzag.Jan 8 2019, 12:12 PM
zzag added inline comments.
xwl/drag_x.cpp
56

QStringLiteral.

Also, I think it would simpler to just return, e.g.

return {QStringLiteral(), QStringLiteral()};
xwl/selection.cpp
59

nullptr

xwl/transfer.h
169

/**

zzag added inline comments.Feb 6 2019, 12:01 PM
xwl/selection.cpp
54–67

Can't we use Xcb::Atom instead?

xwl/transfer.cpp
486–506

Could you please clarify format of NETSCAPE_URL? According to https://chromium.googlesource.com/chromium/src/+/3624c6c095108839db78c01dce92c731cf10b954/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc#178 it looks we don't need this loop.

Why do we have to remove each second line?

xwl/transfer.h
172

**/

see D18683

This revision was not accepted when it landed; it landed in state Needs Review.Feb 19 2019, 12:17 PM
This revision was automatically updated to reflect the committed changes.
romangg marked 2 inline comments as done.