aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/xwayland
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-06-16 19:52:07 +0200
committerVaxry <[email protected]>2024-06-16 19:52:07 +0200
commit069a21a34ef062bb278cf70f153cfdd0bfec9df2 (patch)
tree180d4c1d8736d176a624a55e92a0518a6289de01 /src/xwayland
parent2031af82fa029aa098357339d502b53c371919d4 (diff)
downloadHyprland-069a21a34ef062bb278cf70f153cfdd0bfec9df2.tar.gz
Hyprland-069a21a34ef062bb278cf70f153cfdd0bfec9df2.zip
xwayland: force default plain mime atoms on known types
ref #6247
Diffstat (limited to 'src/xwayland')
-rw-r--r--src/xwayland/XDataSource.cpp14
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;
+ }
}
}