head-management: add tearing-state-v1 extension
This commit is contained in:
parent
aaef75f9f3
commit
4482c3168b
10 changed files with 140 additions and 4 deletions
|
|
@ -32,6 +32,7 @@ use {
|
|||
ext_workspace_manager_v1::WorkspaceManagerId,
|
||||
},
|
||||
wp_content_type_v1::ContentType,
|
||||
wp_presentation_feedback::KIND_VSYNC,
|
||||
zwlr_layer_shell_v1::{BACKGROUND, BOTTOM, OVERLAY, TOP},
|
||||
zwlr_screencopy_frame_v1::ZwlrScreencopyFrameV1,
|
||||
},
|
||||
|
|
@ -47,10 +48,10 @@ use {
|
|||
WorkspaceNodeId, walker::NodeVisitor,
|
||||
},
|
||||
utils::{
|
||||
asyncevent::AsyncEvent, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
||||
errorfmt::ErrorFmt, event_listener::EventSource, hash_map_ext::HashMapExt,
|
||||
linkedlist::LinkedList, on_drop_event::OnDropEvent, scroller::Scroller,
|
||||
transform_ext::TransformExt,
|
||||
asyncevent::AsyncEvent, bitflags::BitflagsExt, clonecell::CloneCell,
|
||||
copyhashmap::CopyHashMap, errorfmt::ErrorFmt, event_listener::EventSource,
|
||||
hash_map_ext::HashMapExt, linkedlist::LinkedList, on_drop_event::OnDropEvent,
|
||||
scroller::Scroller, transform_ext::TransformExt,
|
||||
},
|
||||
wire::{
|
||||
ExtImageCopyCaptureSessionV1Id, JayOutputId, JayScreencastId, ZwlrScreencopyFrameV1Id,
|
||||
|
|
@ -107,6 +108,7 @@ pub struct OutputNode {
|
|||
pub tray_items: LinkedList<Rc<dyn DynTrayItem>>,
|
||||
pub ext_workspace_groups: CopyHashMap<WorkspaceManagerId, Rc<ExtWorkspaceGroupHandleV1>>,
|
||||
pub pinned: LinkedList<Rc<dyn PinnedNode>>,
|
||||
pub tearing: Cell<bool>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
|
|
@ -218,6 +220,13 @@ impl OutputNode {
|
|||
if locked && let Some(lock) = self.state.lock.lock.get() {
|
||||
lock.check_locked()
|
||||
}
|
||||
let tearing = flags.not_contains(KIND_VSYNC);
|
||||
if self.tearing.replace(tearing) != tearing {
|
||||
self.global
|
||||
.connector
|
||||
.head_managers
|
||||
.handle_tearing_active_change(tearing);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_exclusive_zones(self: &Rc<Self>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue