Add support for experimental xx_foreign_toplevel_geometry_tracker_v1 (#1)
Co-authored-by: entailz <entail-wraps0r@icloud.com> Reviewed-on: wry/wry#1 Co-authored-by: entailz <entailzwrapped@proton.me> Co-committed-by: entailz <entailzwrapped@proton.me>
This commit is contained in:
parent
4e9b6def83
commit
f056727621
36 changed files with 497 additions and 243 deletions
|
|
@ -21,6 +21,7 @@ use {
|
|||
xdg_surface::xdg_toplevel::XdgToplevelToplevelData,
|
||||
},
|
||||
wp_content_type_v1::ContentType,
|
||||
xx_foreign_toplevel_geometry_tracker_v1::XxForeignToplevelGeometryTrackerV1,
|
||||
zwlr_foreign_toplevel_handle_v1::ZwlrForeignToplevelHandleV1,
|
||||
zwlr_foreign_toplevel_manager_v1::ZwlrForeignToplevelManagerV1,
|
||||
},
|
||||
|
|
@ -37,7 +38,7 @@ use {
|
|||
},
|
||||
wire::{
|
||||
ExtForeignToplevelHandleV1Id, ExtImageCopyCaptureSessionV1Id, JayScreencastId,
|
||||
JayToplevelId, ZwlrForeignToplevelHandleV1Id,
|
||||
JayToplevelId, XxForeignToplevelGeometryTrackerV1Id, ZwlrForeignToplevelHandleV1Id,
|
||||
},
|
||||
},
|
||||
jay_config::{window, window::WindowType},
|
||||
|
|
@ -195,7 +196,13 @@ impl<T: ToplevelNodeBase> ToplevelNode for T {
|
|||
data.float_width.set(rect.width());
|
||||
data.float_height.set(rect.height());
|
||||
}
|
||||
self.tl_change_extents_impl(rect)
|
||||
let _ = data;
|
||||
let slf = self.clone();
|
||||
self.tl_change_extents_impl(rect);
|
||||
let data = slf.tl_data();
|
||||
for tracker in data.geometry_trackers.lock().values() {
|
||||
tracker.send_geometry_update(rect, &data.state);
|
||||
}
|
||||
}
|
||||
|
||||
fn tl_set_visible(&self, visible: bool) {
|
||||
|
|
@ -401,6 +408,10 @@ pub struct ToplevelData {
|
|||
pub identifier: Cell<ToplevelIdentifier>,
|
||||
pub handles:
|
||||
CopyHashMap<(ClientId, ExtForeignToplevelHandleV1Id), Rc<ExtForeignToplevelHandleV1>>,
|
||||
pub geometry_trackers: CopyHashMap<
|
||||
(ClientId, XxForeignToplevelGeometryTrackerV1Id),
|
||||
Rc<XxForeignToplevelGeometryTrackerV1>,
|
||||
>,
|
||||
pub manager_handles:
|
||||
CopyHashMap<(ClientId, ZwlrForeignToplevelHandleV1Id), Rc<ZwlrForeignToplevelHandleV1>>,
|
||||
pub render_highlight: NumCell<u32>,
|
||||
|
|
@ -459,6 +470,7 @@ impl ToplevelData {
|
|||
app_id: Default::default(),
|
||||
identifier: Cell::new(id),
|
||||
handles: Default::default(),
|
||||
geometry_trackers: Default::default(),
|
||||
manager_handles: Default::default(),
|
||||
render_highlight: Default::default(),
|
||||
jay_toplevels: Default::default(),
|
||||
|
|
@ -563,6 +575,12 @@ impl ToplevelData {
|
|||
handle.send_closed();
|
||||
}
|
||||
}
|
||||
{
|
||||
let mut trackers = self.geometry_trackers.lock();
|
||||
for tracker in trackers.drain_values() {
|
||||
tracker.send_finished();
|
||||
}
|
||||
}
|
||||
self.detach_node(node);
|
||||
self.property_changed(TL_CHANGED_DESTROYED);
|
||||
}
|
||||
|
|
@ -951,7 +969,6 @@ impl ToplevelData {
|
|||
};
|
||||
parent.node_is_workspace()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Drop for ToplevelData {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue