diff options
author | Vaxry <[email protected]> | 2024-06-16 19:52:07 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-06-16 19:52:07 +0200 |
commit | 069a21a34ef062bb278cf70f153cfdd0bfec9df2 (patch) | |
tree | 180d4c1d8736d176a624a55e92a0518a6289de01 | |
parent | 2031af82fa029aa098357339d502b53c371919d4 (diff) | |
download | Hyprland-069a21a34ef062bb278cf70f153cfdd0bfec9df2.tar.gz Hyprland-069a21a34ef062bb278cf70f153cfdd0bfec9df2.zip |
xwayland: force default plain mime atoms on known types
ref #6247
-rw-r--r-- | src/xwayland/XDataSource.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/xwayland/XDataSource.cpp b/src/xwayland/XDataSource.cpp index 98e0701b..f4059ee1 100644 --- a/src/xwayland/XDataSource.cpp +++ b/src/xwayland/XDataSource.cpp @@ -49,10 +49,16 @@ std::vector<std::string> CXDataSource::mimes() { void CXDataSource::send(const std::string& mime, uint32_t fd) { xcb_atom_t mimeAtom = 0; - for (size_t i = 0; i < mimeTypes.size(); ++i) { - if (mimeTypes.at(i) == mime) { - mimeAtom = mimeAtoms.at(i); - break; + if (mime == "text/plain") + mimeAtom = HYPRATOMS["TEXT"]; + else if (mime == "text/plain;charset=utf-8") + mimeAtom = HYPRATOMS["UTF8_STRING"]; + else { + for (size_t i = 0; i < mimeTypes.size(); ++i) { + if (mimeTypes.at(i) == mime) { + mimeAtom = mimeAtoms.at(i); + break; + } } } |