From 5b58d8aef3f87ee3f04f1b7dad9b7698d1543c8f Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Wed, 31 Jan 2024 17:10:50 -0800 Subject: [PATCH] remove x11rb_protocol, use re-exports from x11rb --- Cargo.lock | 1 - Cargo.toml | 1 - src/main.rs | 7 ++++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fd70a7..e29ac80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,7 +59,6 @@ dependencies = [ "anyhow", "as-raw-xcb-connection", "x11rb", - "x11rb-protocol", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2d7a7a4..19b5dee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,5 +8,4 @@ edition = "2021" [dependencies] as-raw-xcb-connection = "1.0.1" x11rb = { version = "0.13.0", features = ["extra-traits", "allow-unsafe-code"] } -x11rb-protocol = { version = "0.13.0", features = ["std"] } anyhow = "1.0.79" diff --git a/src/main.rs b/src/main.rs index b0b7fc9..14e86b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,18 +3,19 @@ use std::process::exit; use anyhow::anyhow; use x11rb::{ - connect, connection::Connection, protocol::xproto::ConnectionExt, xcb_ffi::ReplyError, + connect, connection::Connection, protocol::xproto::{ConnectionExt, Screen}, }; -use x11rb_protocol::protocol::xproto::{ChangeWindowAttributesAux, EventMask, Screen}; fn become_wm(conn: &C, screen: &Screen) -> anyhow::Result<()> { + use x11rb::{protocol::xproto::{ChangeWindowAttributesAux, EventMask}, xcb_ffi::ReplyError}; + let change = ChangeWindowAttributesAux::default() .event_mask(EventMask::SUBSTRUCTURE_REDIRECT | EventMask::SUBSTRUCTURE_NOTIFY); let res = conn.change_window_attributes(screen.root, &change)?.check(); if let Err(ReplyError::X11Error(ref error)) = res { - use x11rb_protocol::protocol::ErrorKind; + use x11rb::protocol::ErrorKind; if error.error_kind == ErrorKind::Access { eprintln!("rswm: another window manager is already running");