1
0
Fork 0
forked from wry/wry

wl_subsurface: unconditionally update visibility upon first parent commit

This commit is contained in:
Julian Orth 2026-03-13 14:34:24 +01:00
parent 00f68e9484
commit ceae42b035
3 changed files with 72 additions and 14 deletions

View file

@ -84,6 +84,7 @@ mod t0050_fifo;
mod t0051_pointer_warp;
mod t0052_bar;
mod t0053_theme;
mod t0054_subsurface_already_attached;
pub trait TestCase: Sync {
fn name(&self) -> &'static str;
@ -156,5 +157,6 @@ pub fn tests() -> Vec<&'static dyn TestCase> {
t0051_pointer_warp,
t0052_bar,
t0053_theme,
t0054_subsurface_already_attached,
}
}

View file

@ -0,0 +1,47 @@
use {
crate::{
it::{test_error::TestError, testrun::TestRun},
theme::Color,
tree::Node,
},
std::rc::Rc,
};
testcase!();
/// Test subsurface with already attached buffer
async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
run.backend.install_default()?;
let seat = run.get_seat("default")?;
run.state.eng.yield_now().await;
run.cfg.show_workspace(seat.id(), "")?;
let client = run.create_client().await?;
let parent = client.create_window().await?;
parent.map().await?;
parent.set_color(0, 0, 0, 255);
let child = client.comp.create_surface().await?;
let buffer = client
.spbm
.create_buffer(Color::from_srgba_straight(255, 255, 255, 255))?;
child.attach(buffer.id)?;
let child_viewport = client.viewporter.get_viewport(&child)?;
child_viewport.set_source(0, 0, 1, 1)?;
child_viewport.set_destination(100, 100)?;
child.commit()?;
let _sub = client
.sub
.get_subsurface(child.id, parent.surface.id)
.await?;
parent.map().await?;
tassert!(child.server.node_visible());
Ok(())
}