Skip to content

Commit

Permalink
Rebase on master
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull committed Jan 7, 2023
1 parent 1aa846c commit 803be8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ features = [
]

[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
bytemuck = { version = "1.12.3", default-features = false, optional = true, features = ["extern_crate_alloc"] }
bytemuck = { version = "1.12.3", default-features = false, optional = true, features = ["derive", "extern_crate_alloc"] }
libc = "0.2.64"
mio = { version = "0.8", features = ["os-ext"], optional = true }
percent-encoding = { version = "2.0", optional = true }
Expand All @@ -113,7 +113,7 @@ sctk-adwaita = { version = "0.5.1", default_features = false, optional = true }
wayland-client = { version = "0.29.4", default_features = false, features = ["use_system_lib"], optional = true }
wayland-protocols = { version = "0.29.4", features = [ "staging_protocols"], optional = true }
x11-dl = { version = "2.18.5", optional = true }
x11rb = { version = "0.11.0", features = ["allow-unsafe-code", "dl-libxcb", "randr", "resource_manager", "xinput", "xkb"] }
x11rb = { version = "0.11.0", features = ["allow-unsafe-code", "dl-libxcb", "randr", "resource_manager", "xinput", "xkb"], optional = true }

[target.'cfg(target_os = "redox")'.dependencies]
orbclient = { version = "0.3.42", default-features = false }
Expand Down
18 changes: 8 additions & 10 deletions src/platform_impl/linux/x11/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ use crate::{
};

use x11rb::{
connection::RequestConnection,
protocol::randr::{self, ConnectionExt as _},
protocol::xproto::{self, ConnectionExt as _},
protocol::xproto,
};

// Used for testing. This should always be committed as false.
Expand Down Expand Up @@ -384,15 +385,12 @@ impl XConnection {
}

pub fn select_xrandr_input(&self, root: xproto::Window) -> Result<u8, PlatformError> {
let extension_info = {
self.connection
.query_extension(randr::X11_EXTENSION_NAME.as_bytes())?
.reply()?
};
assert!(
extension_info.present,
"[winit] XRandR extension not available."
);
let extension_info = self
.connection
.extension_information(randr::X11_EXTENSION_NAME)?
.unwrap_or_else(|| {
panic!("[winit] XRandR extension not available.");
});

// Get the event and error offset for XRandR.
let event_offset = extension_info.first_event;
Expand Down

0 comments on commit 803be8d

Please sign in to comment.