diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-11-12 00:36:19 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-11-12 14:23:50 -0700 |
| commit | 7c457902864fd3e54832dd22bf33f324b6ec3cdb (patch) | |
| tree | 6991a0dc8f0eb832e8b60f094789e15a2b59f737 /src/x | |
| parent | 6480f84e8ee9839fb486916d708712daf34a0aff (diff) | |
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
Diffstat (limited to 'src/x')
| -rw-r--r-- | src/x/connection.rs | 10 | ||||
| -rw-r--r-- | src/x/display.rs | 2 |
2 files changed, 7 insertions, 5 deletions
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<T: HasConnection> 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<Display> { impl Display { pub fn new() -> xcb::Result<Display> { - let (connection, screen_index) = Connection::connect(None)?; + let (connection, screen_index) = Connection::connect()?; let atoms = connection.get_atoms()?; |