subsurface_widget: Sort parent WlSurface, not ObjectId

This commit is contained in:
Ian Douglas Scott 2025-03-27 12:10:32 -07:00 committed by Ashley Wulber
parent 9f07d15617
commit 02bd5d17ef
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
5 changed files with 18 additions and 19 deletions

View file

@ -42,7 +42,6 @@ use cctk::sctk::{
shm::slot::SlotPool,
};
use iced_futures::core::window;
use wayland_backend::client::ObjectId;
use wayland_protocols::wp::{
alpha_modifier::v1::client::{
wp_alpha_modifier_surface_v1::WpAlphaModifierSurfaceV1,
@ -370,7 +369,7 @@ pub struct SubsurfaceState {
pub(crate) unmapped_subsurfaces: Vec<SubsurfaceInstance>,
pub new_iced_subsurfaces: Vec<(
window::Id,
ObjectId,
WlSurface,
window::Id,
WlSubsurface,
WlSurface,
@ -459,7 +458,7 @@ impl SubsurfaceState {
wp_fractional_scale: None,
transform: wl_output::Transform::Normal,
z: 0,
parent: parent.id(),
parent: parent.clone(),
}
}
@ -622,7 +621,7 @@ pub(crate) struct SubsurfaceInstance {
pub(crate) bounds: Option<Rectangle<f32>>,
pub(crate) transform: wl_output::Transform,
pub(crate) z: u32,
pub parent: ObjectId,
pub parent: WlSurface,
}
impl SubsurfaceInstance {
@ -729,7 +728,7 @@ pub(crate) struct SubsurfaceInfo {
thread_local! {
static SUBSURFACES: RefCell<Vec<SubsurfaceInfo>> = RefCell::new(Vec::new());
static ICED_SUBSURFACES: RefCell<Vec<(window::Id, ObjectId, window::Id, WlSubsurface, WlSurface, u32)>> = RefCell::new(Vec::new());
static ICED_SUBSURFACES: RefCell<Vec<(window::Id, WlSurface, window::Id, WlSubsurface, WlSurface, u32)>> = RefCell::new(Vec::new());
}
pub(crate) fn take_subsurfaces() -> Vec<SubsurfaceInfo> {
@ -742,7 +741,7 @@ pub(crate) fn subsurface_ids(parent: WindowId) -> Vec<WindowId> {
.borrow_mut()
.iter()
.filter_map(|s| {
if winit::window::WindowId::from_raw(s.1.as_ptr() as usize)
if winit::window::WindowId::from_raw(s.1.id().as_ptr() as usize)
== parent
{
Some(winit::window::WindowId::from_raw(