Skip to content

Linux + iPhone Continuity / iMessage / SMS

mer

Zack Bartel59c2401cf7d4
diff --git a/src/core/src/clipboard.cpp b/src/core/src/clipboard.cpp
index 1d666a9..b12b5d8 100644
--- a/src/core/src/clipboard.cpp
+++ b/src/core/src/clipboard.cpp
@@ -38,8 +38,12 @@ ClipboardManager::ClipboardManager(CCZwlrDataControlManagerV1* manager, CCWlSeat
static const std::vector<std::string> priorities = {
"text/plain;charset=utf-8",
+ "text/plain;charset=UTF-8",
"UTF8_STRING",
- "text/plain"
+ "text/plain;charset=utf8",
+ "text/plain",
+ "TEXT",
+ "STRING"
};
for (const auto& p : priorities) {
@@ -53,6 +57,15 @@ ClipboardManager::ClipboardManager(CCZwlrDataControlManagerV1* manager, CCWlSeat
if (found) break;
}
+ // Catch-all fallback: if none of our preferred types are found,
+ // try the first thing the compositor offered.
+ if (!found && !current_mimes_.empty()) {
+ best_mime = current_mimes_[0];
+ found = true;
+ }
+
+ if (!found) return;
+
int pipefs[2];
if (pipe(pipefs) < 0) return;
diff --git a/src/core/src/wayland.cpp b/src/core/src/wayland.cpp
index d139183..896c77d 100644
--- a/src/core/src/wayland.cpp
+++ b/src/core/src/wayland.cpp
@@ -42,7 +42,8 @@ bool WaylandContext::init() {
}
});
- // synchronous roundtrips to populate globals
+ // synchronous roundtrips to populate globals and capture initial selection
+ wl_display_roundtrip(raw_display_);
wl_display_roundtrip(raw_display_);
wl_display_roundtrip(raw_display_);