mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
Improve type detection
This commit is contained in:
@@ -3642,11 +3642,9 @@ const Clipboard = struct {
|
||||
// pass through when the clipboard contains non-text content (e.g., images).
|
||||
if (state == .paste) {
|
||||
const formats = clipboard.getFormats();
|
||||
if (formats.containMimeType("text/plain") == 0 and
|
||||
formats.containMimeType("UTF8_STRING") == 0 and
|
||||
formats.containMimeType("TEXT") == 0 and
|
||||
formats.containMimeType("STRING") == 0)
|
||||
{
|
||||
// G_TYPE_STRING = G_TYPE_MAKE_FUNDAMENTAL(16) = (16 << 2) = 64
|
||||
const G_TYPE_STRING: usize = 64;
|
||||
if (formats.containGtype(G_TYPE_STRING) == 0) {
|
||||
log.debug("clipboard has no text format, not starting paste request", .{});
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user