diff --git a/app/selector/mac/fx_cast_selector/ReceiverView.swift b/app/selector/mac/fx_cast_selector/ReceiverView.swift index d187aac..3176aa4 100644 --- a/app/selector/mac/fx_cast_selector/ReceiverView.swift +++ b/app/selector/mac/fx_cast_selector/ReceiverView.swift @@ -75,15 +75,26 @@ class ReceiverView : NSStackView { self.addArrangedSubview(self.castButton) self.distribution = .fill + + + var wasDisabled = false NSEvent.addLocalMonitorForEvents( matching: .flagsChanged) { event in - if !self.receiver.status.application.isIdleScreen && - event.modifierFlags.contains(.option) { + if wasDisabled { + self.castButton.isEnabled = false + } + + if event.modifierFlags.contains(.option) { self.castButton.title = InitDataProvider.shared.data.i18n_stopButtonTitle self.castButton.action = #selector(ReceiverView.onStop) + if !self.castButton.isEnabled { + self.castButton.isEnabled = + !self.receiver.status.application.isIdleScreen + wasDisabled = self.castButton.isEnabled + } } else { self.castButton.title = InitDataProvider.shared.data.i18n_castButtonTitle diff --git a/ext/src/ui/popup/index.tsx b/ext/src/ui/popup/index.tsx index 910b014..b4f5aa9 100755 --- a/ext/src/ui/popup/index.tsx +++ b/ext/src/ui/popup/index.tsx @@ -302,7 +302,7 @@ class ReceiverEntry extends Component { , (this.state.isLoading ? this.state.ellipsis : "")) - : !application.isIdleScreen && this.state.showAlternateAction + : this.state.showAlternateAction ? _("popupStopButtonTitle") : _("popupCastButtonTitle") }