commit
e2f538eec7
14 changed files with 96 additions and 9 deletions
|
|
@ -200,6 +200,15 @@ impl Drop for PendingJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CpuWorkerData {
|
impl CpuWorkerData {
|
||||||
|
fn clear(&self) {
|
||||||
|
self.jobs_to_enqueue.clear();
|
||||||
|
self.new_jobs.lock().clear();
|
||||||
|
self.completed_jobs_remote.lock().queue.clear();
|
||||||
|
self.completed_jobs_local.borrow_mut().clear();
|
||||||
|
self.pending_jobs.clear();
|
||||||
|
self.pending_job_data_cache.take();
|
||||||
|
}
|
||||||
|
|
||||||
async fn wait_for_completions(self: Rc<Self>) {
|
async fn wait_for_completions(self: Rc<Self>) {
|
||||||
let mut buf = TypedBuf::<u64>::new();
|
let mut buf = TypedBuf::<u64>::new();
|
||||||
loop {
|
loop {
|
||||||
|
|
@ -302,6 +311,10 @@ impl CpuWorker {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.data.clear();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn submit(&self, job: Box<dyn CpuJob>) -> PendingJob {
|
pub fn submit(&self, job: Box<dyn CpuJob>) -> PendingJob {
|
||||||
let mut job = NonNull::from(Box::leak(job));
|
let mut job = NonNull::from(Box::leak(job));
|
||||||
let id = self.data.next.next();
|
let id = self.data.next.next();
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,18 @@ pub struct RootMatchers {
|
||||||
exe: ClmRootMatcherMap<ClmMatchExe>,
|
exe: ClmRootMatcherMap<ClmMatchExe>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl RootMatchers {
|
||||||
|
fn clear(&self) {
|
||||||
|
self.sandbox_app_id.clear();
|
||||||
|
self.sandbox_engine.clear();
|
||||||
|
self.sandbox_instance_id.clear();
|
||||||
|
self.uid.clear();
|
||||||
|
self.pid.clear();
|
||||||
|
self.comm.clear();
|
||||||
|
self.exe.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn handle_cl_changes(state: Rc<State>) {
|
pub async fn handle_cl_changes(state: Rc<State>) {
|
||||||
let mgr = &state.cl_matcher_manager;
|
let mgr = &state.cl_matcher_manager;
|
||||||
loop {
|
loop {
|
||||||
|
|
@ -112,6 +124,10 @@ impl ClMatcherManager {
|
||||||
pub fn clear(&self) {
|
pub fn clear(&self) {
|
||||||
self.changes.clear();
|
self.changes.clear();
|
||||||
self.leaf_events.clear();
|
self.leaf_events.clear();
|
||||||
|
self.constant.values().for_each(|c| c.clear());
|
||||||
|
self.sandboxed.values().for_each(|c| c.clear());
|
||||||
|
self.is_xwayland.values().for_each(|c| c.clear());
|
||||||
|
self.matchers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rematch_all(&self, state: &Rc<State>) {
|
pub fn rematch_all(&self, state: &Rc<State>) {
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,10 @@ where
|
||||||
slf
|
slf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.downstream.clear();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn handle(&self, target: &Target) {
|
pub fn handle(&self, target: &Target) {
|
||||||
let new = self.criterion.matches(target) ^ self.not;
|
let new = self.criterion.matches(target) ^ self.not;
|
||||||
let node = match new {
|
let node = match new {
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,10 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.nodes.clear()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_matched(
|
pub fn update_matched(
|
||||||
&self,
|
&self,
|
||||||
target: &Target,
|
target: &Target,
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.data.borrow_mut().clear();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut<T> {
|
pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut<T> {
|
||||||
RefMut::map(self.data.borrow_mut(), |d| {
|
RefMut::map(self.data.borrow_mut(), |d| {
|
||||||
&mut d
|
&mut d
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,22 @@ pub struct RootMatchers {
|
||||||
content_ty: TlmRootMatcherMap<TlmMatchContentType>,
|
content_ty: TlmRootMatcherMap<TlmMatchContentType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl RootMatchers {
|
||||||
|
fn clear(&self) {
|
||||||
|
self.kinds.clear();
|
||||||
|
self.clients.clear();
|
||||||
|
self.title.clear();
|
||||||
|
self.tag.clear();
|
||||||
|
self.app_id.clear();
|
||||||
|
self.seat_foci.clear();
|
||||||
|
self.class.clear();
|
||||||
|
self.instance.clear();
|
||||||
|
self.role.clear();
|
||||||
|
self.workspace.clear();
|
||||||
|
self.content_ty.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn handle_tl_changes(state: Rc<State>) {
|
pub async fn handle_tl_changes(state: Rc<State>) {
|
||||||
let mgr = &state.tl_matcher_manager;
|
let mgr = &state.tl_matcher_manager;
|
||||||
loop {
|
loop {
|
||||||
|
|
@ -159,6 +175,13 @@ impl TlMatcherManager {
|
||||||
self.changes.clear();
|
self.changes.clear();
|
||||||
self.leaf_events.clear();
|
self.leaf_events.clear();
|
||||||
self.handle_just_mapped.clear();
|
self.handle_just_mapped.clear();
|
||||||
|
self.constant.values().for_each(|c| c.clear());
|
||||||
|
self.floating.values().for_each(|c| c.clear());
|
||||||
|
self.visible.values().for_each(|c| c.clear());
|
||||||
|
self.urgent.values().for_each(|c| c.clear());
|
||||||
|
self.fullscreen.values().for_each(|c| c.clear());
|
||||||
|
self.just_mapped.values().for_each(|c| c.clear());
|
||||||
|
self.matchers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rematch_all(&self, state: &Rc<State>) {
|
pub fn rematch_all(&self, state: &Rc<State>) {
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,8 @@ mod leaks {
|
||||||
unsafe impl GlobalAlloc for TracingAllocator {
|
unsafe impl GlobalAlloc for TracingAllocator {
|
||||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||||
unsafe {
|
unsafe {
|
||||||
let res = c::calloc(layout.size(), 1) as *mut u8;
|
let res = c::aligned_alloc(layout.align(), layout.size()) as *mut u8;
|
||||||
|
c::memset(res.cast(), 0, layout.size());
|
||||||
if IN_ALLOCATOR.get() == 0 {
|
if IN_ALLOCATOR.get() == 0 {
|
||||||
IN_ALLOCATOR.set(1);
|
IN_ALLOCATOR.set(1);
|
||||||
ALLOCATIONS.get().deref_mut().insert(
|
ALLOCATIONS.get().deref_mut().insert(
|
||||||
|
|
|
||||||
|
|
@ -1006,6 +1006,7 @@ impl State {
|
||||||
self.run_toplevel.clear();
|
self.run_toplevel.clear();
|
||||||
self.xwayland.handler.borrow_mut().take();
|
self.xwayland.handler.borrow_mut().take();
|
||||||
self.xwayland.queue.clear();
|
self.xwayland.queue.clear();
|
||||||
|
self.xwayland.windows.clear();
|
||||||
self.idle.inhibitors.clear();
|
self.idle.inhibitors.clear();
|
||||||
self.idle.change.clear();
|
self.idle.change.clear();
|
||||||
for drm_dev in self.drm_devs.lock().drain_values() {
|
for drm_dev in self.drm_devs.lock().drain_values() {
|
||||||
|
|
@ -1068,6 +1069,11 @@ impl State {
|
||||||
self.position_hint_requests.clear();
|
self.position_hint_requests.clear();
|
||||||
self.head_managers.clear();
|
self.head_managers.clear();
|
||||||
self.head_managers_async.clear();
|
self.head_managers_async.clear();
|
||||||
|
self.const_40hz_latch.clear();
|
||||||
|
self.cursor_user_groups.clear();
|
||||||
|
self.cursor_user_group_hardware_cursor.take();
|
||||||
|
self.cpu_worker.clear();
|
||||||
|
self.wait_for_sync_obj.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_toplevel_id(&self, id: ToplevelIdentifier) {
|
pub fn remove_toplevel_id(&self, id: ToplevelIdentifier) {
|
||||||
|
|
|
||||||
|
|
@ -404,6 +404,7 @@ impl ConnectorHandler {
|
||||||
}
|
}
|
||||||
self.state
|
self.state
|
||||||
.remove_output_scale(on.global.persistent.scale.get());
|
.remove_output_scale(on.global.persistent.scale.get());
|
||||||
|
on.clear();
|
||||||
let _ = self.state.remove_global(&global);
|
let _ = self.state.remove_global(&global);
|
||||||
let _ = self.state.remove_global(&tray);
|
let _ = self.state.remove_global(&tray);
|
||||||
self.state.tree_changed();
|
self.state.tree_changed();
|
||||||
|
|
|
||||||
|
|
@ -439,13 +439,16 @@ impl OutputNode {
|
||||||
for workspace in workspaces {
|
for workspace in workspaces {
|
||||||
workspace.clear();
|
workspace.clear();
|
||||||
}
|
}
|
||||||
self.render_data.borrow_mut().titles.clear();
|
|
||||||
self.lock_surface.take();
|
self.lock_surface.take();
|
||||||
self.jay_outputs.clear();
|
self.jay_outputs.clear();
|
||||||
self.screencasts.clear();
|
self.screencasts.clear();
|
||||||
self.screencopies.clear();
|
self.screencopies.clear();
|
||||||
self.ext_copy_sessions.clear();
|
self.ext_copy_sessions.clear();
|
||||||
self.ext_workspace_groups.clear();
|
self.ext_workspace_groups.clear();
|
||||||
|
self.latch_event.clear();
|
||||||
|
self.vblank_event.clear();
|
||||||
|
self.presentation_event.clear();
|
||||||
|
self.render_data.borrow_mut().clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn on_spaces_changed(self: &Rc<Self>) {
|
pub fn on_spaces_changed(self: &Rc<Self>) {
|
||||||
|
|
@ -1418,6 +1421,13 @@ pub struct OutputRenderData {
|
||||||
pub status: Option<OutputStatus>,
|
pub status: Option<OutputStatus>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl OutputRenderData {
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.titles.clear();
|
||||||
|
self.status.take();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Debug for OutputNode {
|
impl Debug for OutputNode {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
f.debug_struct("OutputNode").finish_non_exhaustive()
|
f.debug_struct("OutputNode").finish_non_exhaustive()
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ impl WorkspaceNode {
|
||||||
self.jay_workspaces.clear();
|
self.jay_workspaces.clear();
|
||||||
self.ext_workspaces.clear();
|
self.ext_workspaces.clear();
|
||||||
self.opt.set(None);
|
self.opt.set(None);
|
||||||
|
self.title_texture.take();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_has_captures(&self) {
|
pub fn update_has_captures(&self) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ impl<T: ?Sized> Default for EventSource<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: ?Sized> EventSource<T> {
|
impl<T: ?Sized> EventSource<T> {
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.on_attach.take();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn iter(&self) -> EventSourceIter<T> {
|
pub fn iter(&self) -> EventSourceIter<T> {
|
||||||
EventSourceIter {
|
EventSourceIter {
|
||||||
iter: self.listeners.iter(),
|
iter: self.listeners.iter(),
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,12 @@ impl WaitForSyncObj {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.inner.ctx.take();
|
||||||
|
self.inner.busy.clear();
|
||||||
|
self.inner.idle.take();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_ctx(&self, ctx: Option<Rc<SyncObjCtx>>) {
|
pub fn set_ctx(&self, ctx: Option<Rc<SyncObjCtx>>) {
|
||||||
self.inner.ctx.set(ctx);
|
self.inner.ctx.set(ctx);
|
||||||
let busy_waiters: Vec<_> = self.inner.busy.lock().drain_values().collect();
|
let busy_waiters: Vec<_> = self.inner.busy.lock().drain_values().collect();
|
||||||
|
|
@ -163,13 +169,6 @@ impl WaitForSyncObj {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for WaitForSyncObj {
|
|
||||||
fn drop(&mut self) {
|
|
||||||
self.inner.busy.clear();
|
|
||||||
self.inner.idle.take();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl WaiterInner {
|
impl WaiterInner {
|
||||||
async fn run(self: Rc<Self>) {
|
async fn run(self: Rc<Self>) {
|
||||||
let mut buf = Buf::new(8);
|
let mut buf = Buf::new(8);
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,7 @@ async fn run(
|
||||||
state.ring.readable(&pidfd).await?;
|
state.ring.readable(&pidfd).await?;
|
||||||
}
|
}
|
||||||
state.xwayland.queue.clear();
|
state.xwayland.queue.clear();
|
||||||
|
state.xwayland.windows.clear();
|
||||||
stderr_read.await;
|
stderr_read.await;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue