Skip to content

Commit

Permalink
output: pending_xdg is written but never read
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Nov 29, 2022
1 parent f1d9c3e commit 355e6f7
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,8 @@ impl OutputState {
let name = pending_info.id;

let version = wl_output.version();
let pending_xdg = self.xdg.get().is_ok();

let xdg_output = if pending_xdg {
let xdg = self.xdg.get().unwrap();

Some(xdg.get_xdg_output(&wl_output, qh, data))
} else {
None
};
let xdg_output = self.xdg.get().ok().map(|xdg| xdg.get_xdg_output(&wl_output, qh, data));

let inner = OutputInner {
name,
Expand All @@ -225,7 +218,6 @@ impl OutputState {

pending_info,
pending_wl: true,
pending_xdg,
};

self.outputs.push(inner);
Expand Down Expand Up @@ -495,16 +487,6 @@ where
inner.current_info = Some(info.clone());
inner.pending_wl = false;

if inner
.xdg_output
.as_ref()
.map(Proxy::version)
.map(|v| v > 3) // version 3 of xdg_output deprecates xdg_output::done
.unwrap_or(false)
{
inner.pending_xdg = false;
}

// Set the user data, see if we need to run scale callbacks
let run_callbacks = data.set(info);

Expand Down Expand Up @@ -568,32 +550,27 @@ where
match event {
zxdg_output_v1::Event::LogicalPosition { x, y } => {
inner.pending_info.logical_position = Some((x, y));
inner.pending_xdg = true;
}
zxdg_output_v1::Event::LogicalSize { width, height } => {
inner.pending_info.logical_size = Some((width, height));
inner.pending_xdg = true;
}
zxdg_output_v1::Event::Name { name } => {
if inner.wl_output.version() < 4 {
inner.pending_info.name = Some(name);
}
inner.pending_xdg = true;
}

zxdg_output_v1::Event::Description { description } => {
if inner.wl_output.version() < 4 {
inner.pending_info.description = Some(description);
}
inner.pending_xdg = true;
}

zxdg_output_v1::Event::Done => {
// This event is deprecated starting in version 3, wl_output::done should be sent instead.
if output.version() < 3 {
let info = inner.pending_info.clone();
inner.current_info = Some(info.clone());
inner.pending_xdg = false;

// Set the user data
data.set(info);
Expand Down Expand Up @@ -718,5 +695,4 @@ struct OutputInner {
current_info: Option<OutputInfo>,
pending_info: OutputInfo,
pending_wl: bool,
pending_xdg: bool,
}

0 comments on commit 355e6f7

Please sign in to comment.