1
0
Fork 0
forked from wry/wry

surface: commit subsurface state during parent commit

This commit is contained in:
Julian Orth 2024-04-04 10:28:30 +02:00
parent a2c907c8c4
commit c5fd2cd989
10 changed files with 125 additions and 69 deletions

View file

@ -69,6 +69,7 @@ mod t0034_workspace_restoration;
mod t0035_scanout_feedback;
mod t0036_idle;
mod t0037_toplevel_drag;
mod t0038_subsurface_parent_state;
pub trait TestCase: Sync {
fn name(&self) -> &'static str;
@ -125,5 +126,6 @@ pub fn tests() -> Vec<&'static dyn TestCase> {
t0035_scanout_feedback,
t0036_idle,
t0037_toplevel_drag,
t0038_subsurface_parent_state,
}
}

View file

@ -0,0 +1,38 @@
use {
crate::{
it::{test_error::TestResult, testrun::TestRun},
theme::Color,
},
std::rc::Rc,
};
testcase!();
async fn test(run: Rc<TestRun>) -> TestResult {
let _ds = run.create_default_setup().await?;
let client = run.create_client().await?;
let win = client.create_window().await?;
win.set_color(255, 255, 255, 255);
win.map2().await?;
let ss = client.comp.create_surface().await?;
let vp = client.viewporter.get_viewport(&ss)?;
vp.set_destination(100, 100)?;
let buf = client.spbm.create_buffer(Color::SOLID_BLACK)?;
ss.attach(buf.id)?;
ss.commit()?;
let ss = client.sub.get_subsurface(ss.id, win.surface.id).await?;
ss.set_position(0, 0)?;
win.surface.commit()?;
client.compare_screenshot("1", false).await?;
ss.set_position(100, 100)?;
win.surface.commit()?;
client.compare_screenshot("2", false).await?;
Ok(())
}