mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 21:32:13 +03:00
fixup linux build
This commit is contained in:
parent
5d037eae52
commit
9fd04f6024
@ -14,6 +14,7 @@ use config::ConfigHandle;
|
||||
use filedescriptor::FileDescriptor;
|
||||
use promise::{Future, Promise};
|
||||
use smithay_client_toolkit as toolkit;
|
||||
use std::any::Any;
|
||||
use std::cell::RefCell;
|
||||
use std::convert::TryInto;
|
||||
use std::io::{Read, Write};
|
||||
@ -610,6 +611,20 @@ impl WindowOps for WaylandWindow {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn notify<T: Any + Send + Sync>(&self, t: T)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let mut t = Some(t);
|
||||
WaylandConnection::with_window_inner(self.0, move |inner| {
|
||||
inner
|
||||
.events
|
||||
.try_send(WindowEvent::Notification(Box::new(t.take().unwrap())))
|
||||
.ok();
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
||||
fn close(&self) -> Future<()> {
|
||||
WaylandConnection::with_window_inner(self.0, |inner| {
|
||||
inner.close();
|
||||
|
@ -12,6 +12,7 @@ use anyhow::{anyhow, Context as _};
|
||||
use async_trait::async_trait;
|
||||
use config::ConfigHandle;
|
||||
use promise::{Future, Promise};
|
||||
use std::any::Any;
|
||||
use std::collections::VecDeque;
|
||||
use std::convert::TryInto;
|
||||
use std::rc::{Rc, Weak};
|
||||
@ -900,6 +901,20 @@ impl WindowOps for XWindow {
|
||||
.await
|
||||
}
|
||||
|
||||
fn notify<T: Any + Send + Sync>(&self, t: T)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let mut t = Some(t);
|
||||
XConnection::with_window_inner(self.0, move |inner| {
|
||||
inner
|
||||
.events
|
||||
.try_send(WindowEvent::Notification(Box::new(t.take().unwrap())))
|
||||
.ok();
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
||||
fn close(&self) -> Future<()> {
|
||||
XConnection::with_window_inner(self.0, |inner| {
|
||||
inner.close();
|
||||
|
@ -11,6 +11,7 @@ use crate::{Clipboard, Dimensions, MouseCursor, ScreenPoint, WindowEventReceiver
|
||||
use async_trait::async_trait;
|
||||
use config::ConfigHandle;
|
||||
use promise::*;
|
||||
use std::any::Any;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub enum Connection {
|
||||
@ -144,6 +145,16 @@ impl WindowOps for Window {
|
||||
Self::Wayland(w) => w.close(),
|
||||
}
|
||||
}
|
||||
fn notify<T: Any + Send + Sync>(&self, t: T)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
match self {
|
||||
Self::X11(x) => x.notify(t),
|
||||
#[cfg(feature = "wayland")]
|
||||
Self::Wayland(w) => w.notify(t),
|
||||
}
|
||||
}
|
||||
|
||||
fn hide(&self) -> Future<()> {
|
||||
match self {
|
||||
|
Loading…
Reference in New Issue
Block a user