x11 TerminalWindow -> X11TerminalWindow
This commit is contained in:
1 parent
d489d8466f
commit
46cc2cdf99
2 files changed
+16
-12
No files matched your search
+7
-6
@@ -3,7 +3,7 @@ use crate::config::Config;
|
||||
use crate::font::FontConfiguration;
|
||||
use crate::futurecore;
|
||||
use crate::guicommon::tabs::TabId;
|
||||
use crate::xwindows::xwin::TerminalWindow;
|
||||
use crate::xwindows::xwin::X11TerminalWindow;
|
||||
use crate::xwindows::Connection;
|
||||
use crate::{spawn_window_impl, Child, MasterPty};
|
||||
use failure::Error;
|
||||
@@ -69,7 +69,7 @@ impl Evented for TabEntry {
|
||||
|
||||
#[derive(Default)]
|
||||
struct Windows {
|
||||
by_id: HashMap<WindowId, TerminalWindow>,
|
||||
by_id: HashMap<WindowId, X11TerminalWindow>,
|
||||
tab_by_id: HashMap<TabId, Rc<TabEntry>>,
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ impl super::GuiSystem for X11GuiSystem {
|
||||
config: &Rc<Config>,
|
||||
fontconfig: &Rc<FontConfiguration>,
|
||||
) -> Result<(), Error> {
|
||||
let window = TerminalWindow::new(
|
||||
let window = X11TerminalWindow::new(
|
||||
&self.event_loop,
|
||||
terminal,
|
||||
master,
|
||||
@@ -199,7 +199,7 @@ impl GuiEventLoop {
|
||||
|
||||
/// Run a function with access to the mutable version of the window with
|
||||
/// the specified window id
|
||||
pub fn with_window<F: FnOnce(&mut TerminalWindow) -> Result<(), Error>>(
|
||||
pub fn with_window<F: FnOnce(&mut X11TerminalWindow) -> Result<(), Error>>(
|
||||
&self,
|
||||
window_id: WindowId,
|
||||
func: F,
|
||||
@@ -257,12 +257,13 @@ impl GuiEventLoop {
|
||||
) -> Result<(), Error> {
|
||||
let (terminal, master, child, fontconfig) = spawn_window_impl(None, config, fontconfig)?;
|
||||
|
||||
let window = TerminalWindow::new(event_loop, terminal, master, child, &fontconfig, config)?;
|
||||
let window =
|
||||
X11TerminalWindow::new(event_loop, terminal, master, child, &fontconfig, config)?;
|
||||
|
||||
self.add_window(window)
|
||||
}
|
||||
|
||||
pub fn add_window(&self, window: TerminalWindow) -> Result<(), Error> {
|
||||
pub fn add_window(&self, window: X11TerminalWindow) -> Result<(), Error> {
|
||||
let window_id = window.window_id();
|
||||
|
||||
let mut windows = self.windows.borrow_mut();
|
||||
|
||||
@@ -35,7 +35,7 @@ struct Host {
|
||||
config: Rc<Config>,
|
||||
}
|
||||
|
||||
pub struct TerminalWindow {
|
||||
pub struct X11TerminalWindow {
|
||||
host: Host,
|
||||
conn: Rc<Connection>,
|
||||
fonts: Rc<FontConfiguration>,
|
||||
@@ -48,7 +48,7 @@ pub struct TerminalWindow {
|
||||
}
|
||||
|
||||
impl<'a> TabHost<'a> {
|
||||
fn with_window<F: 'static + Fn(&mut TerminalWindow) -> Result<(), Error>>(&self, func: F) {
|
||||
fn with_window<F: 'static + Fn(&mut X11TerminalWindow) -> Result<(), Error>>(&self, func: F) {
|
||||
let events = Rc::clone(&self.host.event_loop);
|
||||
let window_id = self.host.window.window.window_id;
|
||||
|
||||
@@ -160,7 +160,7 @@ impl<'a> term::TerminalHost for TabHost<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl TerminalWindow {
|
||||
impl X11TerminalWindow {
|
||||
pub fn new(
|
||||
event_loop: &Rc<GuiEventLoop>,
|
||||
terminal: term::Terminal,
|
||||
@@ -168,7 +168,7 @@ impl TerminalWindow {
|
||||
process: Child,
|
||||
fonts: &Rc<FontConfiguration>,
|
||||
config: &Rc<Config>,
|
||||
) -> Result<TerminalWindow, Error> {
|
||||
) -> Result<X11TerminalWindow, Error> {
|
||||
let palette = config
|
||||
.colors
|
||||
.as_ref()
|
||||
@@ -201,7 +201,7 @@ impl TerminalWindow {
|
||||
|
||||
let tab = Tab::new(terminal, process, pty);
|
||||
|
||||
Ok(TerminalWindow {
|
||||
Ok(X11TerminalWindow {
|
||||
host,
|
||||
renderer,
|
||||
conn: Rc::clone(&event_loop.conn),
|
||||
@@ -220,7 +220,10 @@ impl TerminalWindow {
|
||||
|
||||
pub fn scaling_changed(&mut self, font_scale: Option<f64>) -> Result<(), Error> {
|
||||
let font_scale = font_scale.unwrap_or_else(|| self.fonts.get_font_scale());
|
||||
eprintln!("TerminalWindow::scaling_changed font_scale={}", font_scale);
|
||||
eprintln!(
|
||||
"X11TerminalWindow::scaling_changed font_scale={}",
|
||||
font_scale
|
||||
);
|
||||
|
||||
self.fonts.change_scaling(font_scale, 1.0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user