mirror of
https://github.com/wez/wezterm.git
synced 2024-12-02 23:55:11 +03:00
start to allow runtime gui frontend changes
This commit is contained in:
parent
98275e78e1
commit
4ab73ebb2c
@ -83,6 +83,8 @@ pub struct GuiEventLoop {
|
||||
const TICK_INTERVAL: Duration = Duration::from_millis(50);
|
||||
const MAX_POLL_LOOP_DURATION: Duration = Duration::from_millis(500);
|
||||
|
||||
impl super::GuiSystem for GuiEventLoop {}
|
||||
|
||||
impl GuiEventLoop {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
let event_loop = glium::glutin::EventsLoop::new();
|
||||
|
@ -1,6 +1,26 @@
|
||||
use super::ExitStatus;
|
||||
use failure::Error;
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, Copy)]
|
||||
pub enum GuiSelection {
|
||||
Glutin,
|
||||
X11,
|
||||
}
|
||||
|
||||
impl Default for GuiSelection {
|
||||
fn default() -> Self {
|
||||
if cfg!(feature = "force-glutin") {
|
||||
GuiSelection::Glutin
|
||||
} else if cfg!(all(unix, not(target_os = "macos"))) {
|
||||
GuiSelection::X11
|
||||
} else {
|
||||
GuiSelection::Glutin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GuiSystem {}
|
||||
|
||||
#[cfg(any(windows, feature = "force-glutin", target_os = "macos"))]
|
||||
mod glutinloop;
|
||||
|
||||
|
@ -71,6 +71,8 @@ const TOK_CORE: usize = 0xffff_ffff;
|
||||
const TOK_CHLD: usize = 0xffff_fffd;
|
||||
const TOK_XCB: usize = 0xffff_fffc;
|
||||
|
||||
impl super::GuiSystem for GuiEventLoop {}
|
||||
|
||||
impl GuiEventLoop {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
let poll = Poll::new()?;
|
||||
|
Loading…
Reference in New Issue
Block a user