chore: Cleanup
This commit is contained in:
parent
800e01a484
commit
92f3dbce01
16 changed files with 329 additions and 277 deletions
|
|
@ -5,6 +5,7 @@ use smithay::{
|
|||
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource},
|
||||
wayland::buffer::BufferHandler,
|
||||
};
|
||||
use tracing::warn;
|
||||
|
||||
impl BufferHandler for State {
|
||||
fn buffer_destroyed(&mut self, buffer: &WlBuffer) {
|
||||
|
|
@ -12,7 +13,9 @@ impl BufferHandler for State {
|
|||
for device in kms_state.drm_devices.values_mut() {
|
||||
if device.active_buffers.remove(&buffer.downgrade()) {
|
||||
if !device.in_use(kms_state.primary_node.as_ref()) {
|
||||
kms_state.refresh_used_devices();
|
||||
if let Err(err) = kms_state.refresh_used_devices() {
|
||||
warn!(?err, "Failed to init devices.");
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,8 +148,7 @@ impl CompositorHandler for State {
|
|||
|
||||
// schedule a new render
|
||||
if let Some(output) = shell.visible_output_for_surface(surface) {
|
||||
self.backend
|
||||
.schedule_render(&self.common.event_loop_handle, &output);
|
||||
self.backend.schedule_render(&output);
|
||||
}
|
||||
|
||||
if mapped {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use smithay::{
|
|||
reexports::wayland_server::Resource,
|
||||
wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportNotifier},
|
||||
};
|
||||
use tracing::warn;
|
||||
|
||||
impl DmabufHandler for State {
|
||||
fn dmabuf_state(&mut self) -> &mut DmabufState {
|
||||
|
|
@ -41,7 +42,9 @@ impl DmabufHandler for State {
|
|||
{
|
||||
device.active_buffers.insert(buffer.downgrade());
|
||||
}
|
||||
kms_state.refresh_used_devices();
|
||||
if let Err(err) = kms_state.refresh_used_devices() {
|
||||
warn!(?err, "Failed to init devices.");
|
||||
};
|
||||
}
|
||||
}
|
||||
Ok(None) => {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use smithay::{
|
|||
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource},
|
||||
wayland::dmabuf::DmabufGlobal,
|
||||
};
|
||||
use tracing::warn;
|
||||
|
||||
impl DrmHandler<Option<DrmNode>> for State {
|
||||
fn dmabuf_imported(
|
||||
|
|
@ -33,7 +34,9 @@ impl DrmHandler<Option<DrmNode>> for State {
|
|||
device.active_buffers.insert(buffer.downgrade());
|
||||
}
|
||||
|
||||
kms_state.refresh_used_devices();
|
||||
if let Err(err) = kms_state.refresh_used_devices() {
|
||||
warn!(?err, "Failed to init devices.");
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ impl WlrLayerShellHandler for State {
|
|||
|
||||
shell.workspaces.recalculate();
|
||||
|
||||
self.backend
|
||||
.schedule_render(&self.common.event_loop_handle, &output);
|
||||
self.backend.schedule_render(&output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,8 +260,7 @@ impl ScreencopyHandler for State {
|
|||
};
|
||||
|
||||
output.add_frame(session, frame);
|
||||
self.backend
|
||||
.schedule_render(&self.common.event_loop_handle, &output);
|
||||
self.backend.schedule_render(&output);
|
||||
}
|
||||
ImageSourceData::Workspace(handle) => {
|
||||
render_workspace_to_buffer(self, session, frame, handle)
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ impl SessionLockHandler for State {
|
|||
});
|
||||
|
||||
for output in shell.outputs() {
|
||||
self.backend
|
||||
.schedule_render(&self.common.event_loop_handle, &output);
|
||||
self.backend.schedule_render(&output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -50,8 +49,7 @@ impl SessionLockHandler for State {
|
|||
shell.session_lock = None;
|
||||
|
||||
for output in shell.outputs() {
|
||||
self.backend
|
||||
.schedule_render(&self.common.event_loop_handle, &output);
|
||||
self.backend.schedule_render(&output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -399,8 +399,7 @@ impl XdgShellHandler for State {
|
|||
}
|
||||
|
||||
if let Some(output) = output.as_ref() {
|
||||
self.backend
|
||||
.schedule_render(&self.common.event_loop_handle, &output);
|
||||
self.backend.schedule_render(&output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue