From 7c457902864fd3e54832dd22bf33f324b6ec3cdb Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 12 Nov 2026 00:36:19 -0700 Subject: draw text this uses Xft, which unfortunately has a lot of parallel tooling it needs some refactoring into its own files, but it works :) Change-Id: I0e78ea69167b1d91af2e9f494d757564d8cb7cdb Force-Push: yes --- src/x/connection.rs | 10 ++++++---- src/x/display.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/x') diff --git a/src/x/connection.rs b/src/x/connection.rs index d9ed9ca..78e721d 100644 --- a/src/x/connection.rs +++ b/src/x/connection.rs @@ -7,11 +7,9 @@ use xcb::x::{ Atom, InternAtom }; pub struct Connection(xcb::Connection); impl Connection { - pub fn connect(display_name: Option<&str>) - -> xcb::ConnResult<(Connection, i32)> - { + pub fn connect() -> xcb::ConnResult<(Connection, i32)> { let (connection, screen_index) - = xcb::Connection::connect(display_name)?; + = xcb::Connection::connect_with_xlib_display()?; Ok((Connection(connection), screen_index)) } @@ -91,6 +89,10 @@ pub trait ConnectionExt: HasConnection { wm_strut, wm_strut_partial, }) } + + fn get_xlib_display(&self) -> *mut x11::xlib::Display { + self.connection().0.get_raw_dpy() + } } impl ConnectionExt for T { } diff --git a/src/x/display.rs b/src/x/display.rs index ca552db..7aa7e2e 100644 --- a/src/x/display.rs +++ b/src/x/display.rs @@ -19,7 +19,7 @@ impl HasConnection for Arc { impl Display { pub fn new() -> xcb::Result { - let (connection, screen_index) = Connection::connect(None)?; + let (connection, screen_index) = Connection::connect()?; let atoms = connection.get_atoms()?; -- cgit 1.4.1