Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
cf9f722e
Commit
cf9f722e
authored
Feb 26, 2021
by
Fabio Bas
Browse files
Klipper Waylandclipboard: force offer of specific mimetype to fix pasting to gtk applications
parent
1cb25441
Changes
1
Hide whitespace changes
Inline
Side-by-side
klipper/systemclipboard/waylandclipboard.cpp
View file @
cf9f722e
...
...
@@ -195,13 +195,23 @@ DataControlSource::DataControlSource(struct ::zwlr_data_control_source_v1 *id, Q
for
(
const
QString
&
format
:
mimeData
->
formats
())
{
offer
(
format
);
}
if
(
mimeData
->
hasText
())
{
// ensure GTK applications get this mimetype to avoid them discarding the offer
offer
(
QStringLiteral
(
"text/plain;charset=utf-8"
));
}
}
void
DataControlSource
::
zwlr_data_control_source_v1_send
(
const
QString
&
mime_type
,
int32_t
fd
)
{
QFile
c
;
QString
send_mime_type
=
mime_type
;
if
(
send_mime_type
==
QStringLiteral
(
"text/plain;charset=utf-8"
))
{
// if we get a request on the fallback mime, send the data from the original mime type
send_mime_type
=
QStringLiteral
(
"text/plain"
);
}
if
(
c
.
open
(
fd
,
QFile
::
WriteOnly
,
QFile
::
AutoCloseHandle
))
{
c
.
write
(
m_mimeData
->
data
(
mime_type
));
c
.
write
(
m_mimeData
->
data
(
send_
mime_type
));
c
.
close
();
}
}
...
...
David Edmundson
@davidedmundson
mentioned in commit
65c69551
·
Mar 16, 2021
mentioned in commit
65c69551
mentioned in commit 65c6955148d8d975fe1f7352f6249be9ac584027
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment