mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-30 02:26:28 +00:00
[client] wayland/clipboard: prefer text/plain over text/html
When both text/plain and text/html are available, we should prefer the plain text as we can't paste HTML.
This commit is contained in:
parent
f3a1eaf557
commit
6419279c3c
@ -210,9 +210,10 @@ static void dataOfferHandleOffer(void * opaque, struct wl_data_offer * offer,
|
|||||||
if (type == LG_CLIPBOARD_DATA_NONE)
|
if (type == LG_CLIPBOARD_DATA_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// text/html represents rich text format and should not be used when an image
|
// text/html represents rich text format, which is almost never desirable when
|
||||||
// format is available.
|
// and should not be used when a plain text or image format is available.
|
||||||
if (isImageCbtype(type) && data->mimetypes[LG_CLIPBOARD_DATA_TEXT] &&
|
if ((isImageCbtype(type) || containsMimetype(textMimetypes, mimetype)) &&
|
||||||
|
data->mimetypes[LG_CLIPBOARD_DATA_TEXT] &&
|
||||||
strstr(data->mimetypes[LG_CLIPBOARD_DATA_TEXT], "html"))
|
strstr(data->mimetypes[LG_CLIPBOARD_DATA_TEXT], "html"))
|
||||||
{
|
{
|
||||||
free(data->mimetypes[LG_CLIPBOARD_DATA_TEXT]);
|
free(data->mimetypes[LG_CLIPBOARD_DATA_TEXT]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user