mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
remove unused channels.
This commit is contained in:
parent
4094639ea9
commit
6e62b796fc
@ -22,6 +22,7 @@ type CaptureManagerCtx struct {
|
||||
|
||||
func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCtx {
|
||||
logger := log.With().Str("module", "capture").Logger()
|
||||
|
||||
return &CaptureManagerCtx{
|
||||
logger: logger,
|
||||
desktop: desktop,
|
||||
|
@ -9,18 +9,10 @@ func (manager *DesktopManagerCtx) GetCursorChangedChannel() chan uint64 {
|
||||
return xevent.CursorChangedChannel
|
||||
}
|
||||
|
||||
func (manager *DesktopManagerCtx) GetClipboardUpdatedChannel() chan bool {
|
||||
func (manager *DesktopManagerCtx) GetClipboardUpdatedChannel() chan struct{} {
|
||||
return xevent.ClipboardUpdatedChannel
|
||||
}
|
||||
|
||||
func (manager *DesktopManagerCtx) GetFileChooserDialogOpenedChannel() chan bool {
|
||||
return xevent.FileChooserDialogOpenedChannel
|
||||
}
|
||||
|
||||
func (manager *DesktopManagerCtx) GetFileChooserDialogClosedChannel() chan bool {
|
||||
return xevent.FileChooserDialogClosedChannel
|
||||
}
|
||||
|
||||
func (manager *DesktopManagerCtx) GetEventErrorChannel() chan types.DesktopErrorMessage {
|
||||
return xevent.EventErrorChannel
|
||||
}
|
||||
|
@ -14,36 +14,20 @@ import (
|
||||
)
|
||||
|
||||
var CursorChangedChannel chan uint64
|
||||
var ClipboardUpdatedChannel chan bool
|
||||
var FileChooserDialogClosedChannel chan bool
|
||||
var FileChooserDialogOpenedChannel chan bool
|
||||
var ClipboardUpdatedChannel chan struct{}
|
||||
var EventErrorChannel chan types.DesktopErrorMessage
|
||||
|
||||
func init() {
|
||||
CursorChangedChannel = make(chan uint64)
|
||||
ClipboardUpdatedChannel = make(chan bool)
|
||||
FileChooserDialogClosedChannel = make(chan bool)
|
||||
FileChooserDialogOpenedChannel = make(chan bool)
|
||||
ClipboardUpdatedChannel = make(chan struct{})
|
||||
EventErrorChannel = make(chan types.DesktopErrorMessage)
|
||||
|
||||
go func() {
|
||||
for {
|
||||
// TODO: Unused.
|
||||
// TODO: Reserved for future use.
|
||||
<-CursorChangedChannel
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
for {
|
||||
// TODO: Unused.
|
||||
<-FileChooserDialogClosedChannel
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
for {
|
||||
// TODO: Unused.
|
||||
<-FileChooserDialogOpenedChannel
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func EventLoop(display string) {
|
||||
@ -53,6 +37,11 @@ func EventLoop(display string) {
|
||||
C.XEventLoop(displayUnsafe)
|
||||
}
|
||||
|
||||
// TODO: Shutdown function.
|
||||
//close(CursorChangedChannel)
|
||||
//close(ClipboardUpdatedChannel)
|
||||
//close(EventErrorChannel)
|
||||
|
||||
//export goXEventCursorChanged
|
||||
func goXEventCursorChanged(event C.XFixesCursorNotifyEvent) {
|
||||
CursorChangedChannel <- uint64(event.cursor_serial)
|
||||
@ -60,7 +49,7 @@ func goXEventCursorChanged(event C.XFixesCursorNotifyEvent) {
|
||||
|
||||
//export goXEventClipboardUpdated
|
||||
func goXEventClipboardUpdated() {
|
||||
ClipboardUpdatedChannel <- true
|
||||
ClipboardUpdatedChannel <- struct{}{}
|
||||
}
|
||||
|
||||
//export goXEventConfigureNotify
|
||||
|
Loading…
Reference in New Issue
Block a user