diff --git a/server/internal/capture/manager.go b/server/internal/capture/manager.go index cfea2ab..9bb88af 100644 --- a/server/internal/capture/manager.go +++ b/server/internal/capture/manager.go @@ -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, diff --git a/server/internal/desktop/xevent.go b/server/internal/desktop/xevent.go index e90f551..b38a9e4 100644 --- a/server/internal/desktop/xevent.go +++ b/server/internal/desktop/xevent.go @@ -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 } diff --git a/server/internal/desktop/xevent/xevent.go b/server/internal/desktop/xevent/xevent.go index 5b30a0a..8c3553a 100644 --- a/server/internal/desktop/xevent/xevent.go +++ b/server/internal/desktop/xevent/xevent.go @@ -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