Add set_clipboard_context function and relevant plumbing. Use Option more consistantly (less unwraps) in textinput's selection handling.

This commit is contained in:
Avi Weinstock 2015-06-18 11:58:03 -04:00
parent 52c2049f2a
commit f86252a60b
5 changed files with 83 additions and 48 deletions

View file

@ -475,6 +475,13 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
);
sender.send(result).unwrap();
}
ConstellationMsg::SetClipboardContents(s) => {
if let Some(ref ctx) = self.clipboard_ctx {
if let Err(e) = ctx.set_contents(s) {
debug!("Error setting clipboard contents ({})", e);
}
}
}
ConstellationMsg::WebDriverCommand(command) => {
debug!("constellation got webdriver command message");
self.handle_webdriver_msg(command);