[idd] network: bind clipboard to input authority

This commit is contained in:
Geoffrey McRae
2026-10-07 16:05:07 +11:00
parent f2eadca4ab
commit 0fecbe4989
9 changed files with 507 additions and 76 deletions

View File

@@ -70,6 +70,12 @@ InputTargetState CInputHub::Source::GetState(
return owner->GetState(Key(source));
}
bool CInputHub::Source::WithAuthority(const InputSourceId& source,
InputAuthorityAction action, void * opaque)
{
return owner->WithAuthority(Key(source), action, opaque);
}
void CInputHub::Source::Failed()
{
owner->Failed(*this);
@@ -565,6 +571,20 @@ InputTargetState CInputHub::GetState(const SourceKey& source)
return result;
}
bool CInputHub::WithAuthority(const SourceKey& source,
InputAuthorityAction action, void * opaque)
{
if (!action)
return false;
CSRWExclusiveLock lock(m_lock);
if (!SourceValid(source) || !CheckState() || !OwnerValid(source))
return false;
action(opaque);
return true;
}
void CInputHub::Failed(Source& source)
{
CSRWExclusiveLock lock(m_lock);