Skip to content

Commit bb78e83

Browse files
committed
Fix behaviour change for wayland
If the mime-type doesn't exist, the process should exit with 0.
1 parent de54253 commit bb78e83

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/clipboard/wayland.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ fn paste_wayland(cfg: PasteConfig) -> Result<()> {
111111
return Ok(());
112112
}
113113

114-
let mime_type = CString::new(decide_mime_type(
115-
&state.config.expected_mime_type,
116-
supported_types,
117-
)?)?;
114+
let mime_type =
115+
if let Ok(type_str) = decide_mime_type(&state.config.expected_mime_type, supported_types) {
116+
CString::new(type_str)?
117+
} else {
118+
return Ok(());
119+
};
118120

119121
// offer.receive needs a fd to write, we cannot use the stdin since the read side of the
120122
// pipe may close earlier before all data written.

0 commit comments

Comments
 (0)