Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Sep 12, 2022
1 parent dcca9aa commit a34d0dc
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 67 deletions.
127 changes: 65 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wl-gammarelay-rs"
version = "0.2.3"
version = "0.3.0"
authors = ["Max Verevkin <[email protected]>"]
edition = "2021"
description = "A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering"
Expand Down
8 changes: 4 additions & 4 deletions src/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn run(mut rx: mpsc::Receiver<Request>) -> Result<()> {
let mut event_queue = conn.new_event_queue();
let mut async_fd = AsyncFd::new(event_queue.prepare_read()?.connection_fd())?;
let qh = event_queue.handle();
let _registry = display.get_registry(&qh, ())?;
let _registry = display.get_registry(&qh, ());

let mut data = AppData {
color: Default::default(),
Expand Down Expand Up @@ -145,12 +145,12 @@ impl Dispatch<wl_registry::WlRegistry, ()> for AppData {
color: Default::default(),
gamma_control: None,
ramp_size: 0,
output: registry.bind(name, version, qh, ()).unwrap(),
output: registry.bind(name, version, qh, ()),
});
}
"zwlr_gamma_control_manager_v1" => {
eprintln!("Found gamma control manager");
state.manager = Some(registry.bind(name, version, qh, ()).unwrap());
state.manager = Some(registry.bind(name, version, qh, ()));
}
_ => (),
},
Expand All @@ -174,7 +174,7 @@ impl Dispatch<wl_output::WlOutput, ()> for AppData {
if let wl_output::Event::Done = e {
if let Some(manager) = &state.manager {
if let Some(output) = state.outputs.iter_mut().find(|o| &o.output == output) {
let gamma = manager.get_gamma_control(&output.output, qh, ()).unwrap();
let gamma = manager.get_gamma_control(&output.output, qh, ());
output.gamma_control = Some(gamma);
state.pending_updates = true;
eprintln!("Output {} initialized", output.name);
Expand Down

0 comments on commit a34d0dc

Please sign in to comment.