1
0
Fork 0
forked from wry/wry

config: allow disabling explicit-sync

This commit is contained in:
Julian Orth 2024-03-26 15:24:07 +01:00
parent aaf73d6fdc
commit aa296a6aea
12 changed files with 58 additions and 2 deletions

View file

@ -224,6 +224,7 @@ fn start_compositor2(
create_default_seat: Cell::new(true),
subsurface_ids: Default::default(),
wait_for_sync_obj: Rc::new(WaitForSyncObj::new(&ring, &engine)),
explicit_sync_enabled: Cell::new(true),
});
state.tracker.register(ClientId::from_raw(0));
create_dummy_output(&state);

View file

@ -800,6 +800,10 @@ impl ConfigProxyHandler {
self.state.idle.set_timeout(timeout);
}
fn handle_set_explicit_sync_enabled(&self, enabled: bool) {
self.state.explicit_sync_enabled.set(enabled);
}
fn handle_connector_connected(&self, connector: Connector) -> Result<(), CphError> {
let connector = self.get_connector(connector)?;
self.respond(Response::ConnectorConnected {
@ -1725,6 +1729,9 @@ impl ConfigProxyHandler {
} => self
.handle_move_to_output(workspace, connector)
.wrn("move_to_output")?,
ClientMessage::SetExplicitSyncEnabled { enabled } => {
self.handle_set_explicit_sync_enabled(enabled)
}
}
Ok(())
}

View file

@ -172,6 +172,7 @@ pub struct State {
pub create_default_seat: Cell<bool>,
pub subsurface_ids: SubsurfaceIds,
pub wait_for_sync_obj: Rc<WaitForSyncObj>,
pub explicit_sync_enabled: Cell<bool>,
}
// impl Drop for State {
@ -450,7 +451,7 @@ impl State {
if !self.render_ctx_ever_initialized.replace(true) {
self.add_global(&Rc::new(WlDrmGlobal::new(self.globals.name())));
self.add_global(&Rc::new(ZwpLinuxDmabufV1Global::new(self.globals.name())));
if ctx.sync_obj_ctx().supports_async_wait() {
if ctx.sync_obj_ctx().supports_async_wait() && self.explicit_sync_enabled.get() {
self.add_global(&Rc::new(WpLinuxDrmSyncobjManagerV1Global::new(
self.globals.name(),
)));