move x11 code around

idea is to reduce the cfg attributes and make it easier to
split into system dependent renderers
This commit is contained in:
Wez Furlong committed 2018-02-20 15:02:39 -08:00
1 parent 5a99dd143c
commit e1cd44922f
4 files changed
+11 -12

No files matched your search

+3 -7
View File
@@ -43,9 +43,9 @@ use std::time::Duration;
mod config;
#[cfg(all(unix, not(target_os = "macos")))]
mod xgfx;
mod xwindows;
#[cfg(all(unix, not(target_os = "macos")))]
mod xkeysyms;
use xwindows::xwin::TerminalWindow;
mod font;
use font::FontConfiguration;
@@ -54,10 +54,6 @@ mod pty;
mod sigchld;
mod textureatlas;
#[cfg(all(unix, not(target_os = "macos")))]
mod xwin;
#[cfg(all(unix, not(target_os = "macos")))]
use xwin::TerminalWindow;
/// Determine which shell to run.
/// We take the contents of the $SHELL env var first, then
@@ -79,7 +75,7 @@ fn get_shell() -> Result<String, Error> {
fn run() -> Result<(), Error> {
let poll = Poll::new()?;
let conn = xgfx::Connection::new()?;
let conn = xwindows::Connection::new()?;
let waiter = sigchld::ChildWaiter::new()?;
+4 -1
View File
@@ -16,7 +16,10 @@ use xcb_util::ffi::keysyms::{xcb_key_press_lookup_keysym, xcb_key_symbols_alloc,
use failure::{self, Error};
pub type Result<T> = result::Result<T, Error>;
pub use xkeysyms::*;
mod xkeysyms;
pub use self::xkeysyms::*;
pub mod xwin;
pub struct Connection {
pub display: *mut x11::xlib::Display,
File renamed without changes.
+4 -4
View File
@@ -1,3 +1,5 @@
use super::{Connection, Drawable, Window};
use super::xkeysyms;
use config::TextStyle;
use euclid;
use failure::{self, Error};
@@ -20,8 +22,6 @@ use term::color::RgbaTuple;
use term::hyperlink::Hyperlink;
use xcb;
use xcb_util;
use xgfx::{self, Connection, Drawable};
use xkeysyms;
use textureatlas::{Atlas, Sprite, SpriteSlice, TEX_SIZE};
@@ -234,7 +234,7 @@ void main() {
/// Holds the information we need to implement TerminalHost
struct Host<'a> {
window: xgfx::Window<'a>,
window: Window<'a>,
pty: MasterPty,
timestamp: xcb::xproto::Timestamp,
clipboard: Option<String>,
@@ -406,7 +406,7 @@ impl<'a> TerminalWindow<'a> {
tuple
};
let window = xgfx::Window::new(&conn, width, height)?;
let window = Window::new(&conn, width, height)?;
window.set_title("wezterm");
let descender = if descender.is_positive() {