Archived
2
0

remove unused channels.

This commit is contained in:
Miroslav Šedivý 2023-01-29 17:51:39 +01:00
parent 4094639ea9
commit 6e62b796fc
3 changed files with 11 additions and 29 deletions

View File

@ -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,

View File

@ -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
}

View File

@ -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