1
0
Fork 0
forked from wry/wry

surface: split ext::pre_commit into two parts

This commit is contained in:
Julian Orth 2024-03-20 19:21:40 +01:00
parent 86d37b5aa4
commit 943626a7f7
5 changed files with 39 additions and 26 deletions

View file

@ -2,8 +2,8 @@ use {
crate::{
client::ClientError,
ifs::wl_surface::{
CommitAction, CommitContext, StackElement, SurfaceExt, SurfaceRole, WlSurface,
WlSurfaceError, WlSurfaceId,
CommitAction, CommitContext, PendingState, StackElement, SurfaceExt, SurfaceRole,
WlSurface, WlSurfaceError, WlSurfaceId,
},
leaks::Tracker,
object::Object,
@ -264,15 +264,15 @@ impl Object for WlSubsurface {
simple_add_obj!(WlSubsurface);
impl SurfaceExt for WlSubsurface {
fn pre_commit(self: Rc<Self>, ctx: CommitContext) -> Result<CommitAction, WlSurfaceError> {
fn prepare_commit(&self, ctx: CommitContext, _pending: &mut PendingState) -> CommitAction {
if ctx == CommitContext::RootCommit && self.sync() {
log::debug!("Aborting commit due to sync");
return Ok(CommitAction::AbortCommit);
return CommitAction::AbortCommit;
}
Ok(CommitAction::ContinueCommit)
CommitAction::ContinueCommit
}
fn post_commit(self: Rc<Self>) {
fn after_apply_commit(self: Rc<Self>, _pending: &mut PendingState) {
if let Some(v) = self.pending.node.take() {
v.pending.set(false);
self.node.borrow_mut().replace(v);