Skip to content

Commit

Permalink
anvil: Skip decoration configure before initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Jan 10, 2023
1 parent e6b3b54 commit 1085be1
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions anvil/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,19 @@ impl<BackendData: Backend> XdgDecorationHandler for AnvilState<BackendData> {
}
});
});
toplevel.send_configure();

let initial_configure_sent = with_states(surface, |states| {
states
.data_map
.get::<XdgToplevelSurfaceData>()
.unwrap()
.lock()
.unwrap()
.initial_configure_sent
});
if initial_configure_sent {
toplevel.send_configure();
}
}
}
fn unset_mode(&mut self, toplevel: ToplevelSurface) {
Expand All @@ -305,7 +317,18 @@ impl<BackendData: Backend> XdgDecorationHandler for AnvilState<BackendData> {
toplevel.with_pending_state(|state| {
state.decoration_mode = Some(Mode::ClientSide);
});
toplevel.send_configure();
let initial_configure_sent = with_states(surface, |states| {
states
.data_map
.get::<XdgToplevelSurfaceData>()
.unwrap()
.lock()
.unwrap()
.initial_configure_sent
});
if initial_configure_sent {
toplevel.send_configure();
}
}
}
}
Expand Down

0 comments on commit 1085be1

Please sign in to comment.