Reset master to testing content
This commit is contained in:
1 parent
0f2587b719
commit
42afa2a56c
1483 files changed
+145308
-938069
No files matched your search
@@ -0,0 +1,54 @@
|
||||
package xorg
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"git.stormux.org/storm/cthulhu/internal/input"
|
||||
)
|
||||
|
||||
func (listener *CommandListener) SetSecureInputActive(active bool) {
|
||||
listener.secureMutex.Lock()
|
||||
defer listener.secureMutex.Unlock()
|
||||
listener.secure.Store(active)
|
||||
if active {
|
||||
listener.browse.Store(false)
|
||||
listener.nativeButtonFocus.Store(false)
|
||||
}
|
||||
for {
|
||||
select {
|
||||
case <-listener.commands:
|
||||
case <-listener.lockStates:
|
||||
default:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (listener *CommandListener) publish_lock_state(state input.LockState) {
|
||||
listener.secureMutex.Lock()
|
||||
defer listener.secureMutex.Unlock()
|
||||
if listener.secure.Load() {
|
||||
return
|
||||
}
|
||||
select {
|
||||
case listener.lockStates <- state:
|
||||
default:
|
||||
select {
|
||||
case listener.failures <- errors.New("X11 lock state queue overflow"):
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (listener *CommandListener) enqueueSecureCommand(command input.CommandEvent) bool {
|
||||
listener.secureMutex.Lock()
|
||||
defer listener.secureMutex.Unlock()
|
||||
if listener.secure.Load() {
|
||||
return true
|
||||
}
|
||||
select {
|
||||
case listener.commands <- command:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user