Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alin23 committed Mar 17, 2023
1 parent d1dad0b commit e5c87d2
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 40 deletions.
46 changes: 27 additions & 19 deletions Lunar/Controllers/QuickActionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -830,17 +830,17 @@ struct DisplayRowView: View {

struct NeedsLunarProView: View {
var body: some View {
PaddedPopoverView(background: AnyView(Colors.red.brightness(0.05))) {
PaddedPopoverView(background: Colors.red.brightness(0.1).any) {
HStack(spacing: 4) {
Text("Needs a")
.foregroundColor(.black)
.font(.system(size: 16, weight: .bold))
.foregroundColor(.black.opacity(0.8))
.font(.system(size: 16, weight: .semibold))
SwiftUI.Button("Lunar Pro") { appDelegate!.getLunarPro(appDelegate!) }
.buttonStyle(FlatButton(color: .black.opacity(0.5), textColor: .white))
.buttonStyle(FlatButton(color: .black.opacity(0.3), textColor: .white))
.font(.system(size: 15, weight: .bold, design: .rounded))
Text("licence")
.foregroundColor(.black)
.font(.system(size: 16, weight: .bold))
.foregroundColor(.black.opacity(0.8))
.font(.system(size: 16, weight: .semibold))
}
}
}
Expand Down Expand Up @@ -1113,12 +1113,15 @@ struct AdvancedSettingsView: View {
#if arch(arm64)
if #available(macOS 13, *) {
SettingsToggle(
text: "Disconnect displays in BlackOut", setting: $newBlackOutDisconnect,
text: "Disable the Disconnect API in BlackOut", setting: !$newBlackOutDisconnect,
help: """
Instead of mirroring the display to disable it, Lunar can also
disconnect the display entirely, freeing up GPU resources.
BlackOut can use a hidden macOS API to disconnect the display entirely,
freeing up GPU resources and allowing for an easy reconnection when needed.
This uses a hidden macOS API that's not guaranteed to work all the time.
If you're having trouble with how this works, you can switch to the old
method of mirroring the display to disable it.
Note: Press ⌘ Command more than 8 times in a row to force connect all displays.
In case the built-in MacBook display doesn't reconnect itself when it should,
close the laptop lid and reopen it to bring the display back.
Expand All @@ -1134,17 +1137,22 @@ struct AdvancedSettingsView: View {
help: "Allows turning off a screen even if it's the only visible screen left"
)

SettingsToggle(
text: "Switch to the old BlackOut mirroring system", setting: $oldBlackOutMirroring,
help: """
Some setups will have trouble enabling mirroring with the new macOS 11+ API.
#if !arch(arm64)
if #available(macOS 13, *) {
} else {
SettingsToggle(
text: "Switch to the old BlackOut mirroring system", setting: $oldBlackOutMirroring,
help: """
Some setups will have trouble enabling mirroring with the new macOS 11+ API.
You can try enabling this option if BlackOut is not working properly.
You can try enabling this option if BlackOut is not working properly.
Note: the old mirroring system can't handle complex mirror sets with dummies and virtual/wireless displays.
The best covered cases are "BlackOut built-in display" and "BlackOut only external displays".
"""
)
Note: the old mirroring system can't handle complex mirror sets with dummies and virtual/wireless displays.
The best covered cases are "BlackOut built-in display" and "BlackOut only external displays".
"""
)
}
#endif
Divider()

SettingsToggle(
Expand Down
26 changes: 22 additions & 4 deletions Lunar/Data/Display.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3846,14 +3846,28 @@ let AUDIO_IDENTIFIER_UUID_PATTERN = "([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{4})-[0
}

func getPowerOffTooltip(hasDDC: Bool? = nil) -> String {
#if arch(arm64)
if #available(macOS 13, *) {
let disconnect = CachedDefaults[.newBlackOutDisconnect]
} else {
let disconnect = false
}
#else
let disconnect = false
#endif

guard !(hasDDC ?? self.hasDDC) else {
return """
BlackOut simulates a monitor power off by mirroring the contents of the other visible screen to this one and setting this monitor's brightness to absolute 0.
\(
disconnect
? "BlackOut disconnects a monitor in software, freeing up GPU resources and removing it from the screen arrangement."
: "BlackOut simulates a monitor power off by mirroring the contents of the other visible screen to this one and setting this monitor's brightness to absolute 0."
)
Can also be toggled with the keyboard using Ctrl-Cmd-6.
Hold the following keys while clicking the button (or while pressing the hotkey) to change BlackOut behaviour:
- Shift: make the screen black without mirroring
- Shift: make the screen black without \(disconnect ? "disconnecting" : "mirroring")
- Option: turn off monitor completely using DDC
- Option and Shift: BlackOut other monitors and keep this one visible
Expand All @@ -3875,12 +3889,16 @@ let AUDIO_IDENTIFIER_UUID_PATTERN = "([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{4})-[0
}

return """
BlackOut simulates a monitor power off by mirroring the contents of the other visible screen to this one and setting this monitor's brightness to absolute 0.
\(
disconnect
? "BlackOut disconnects a monitor in software, freeing up GPU resources and removing it from the screen arrangement."
: "BlackOut simulates a monitor power off by mirroring the contents of the other visible screen to this one and setting this monitor's brightness to absolute 0."
)
Can also be toggled with the keyboard using Ctrl-Cmd-6.
Hold the following keys while clicking the button (or while pressing the hotkey) to change BlackOut behaviour:
- Shift: make the screen black without mirroring
- Shift: make the screen black without \(disconnect ? "disconnecting" : "mirroring")
- Option and Shift: BlackOut other monitors and keep this one visible
Emergency Kill Switch: press the ⌘ Command key more than 8 times in a row to force disable BlackOut.
Expand Down
2 changes: 1 addition & 1 deletion Lunar/Utils/DisplayController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ final class DisplayController: ObservableObject {
}

static func autoMode() -> AdaptiveMode {
// guard initialized else { return ManualMode.shared }
guard lunarProActive || lunarProOnTrial else { return ManualMode.shared }

if let mode = SensorMode.specific.ifExternalSensorAvailable() {
return mode
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ ifneq (, $(CHANNEL))
rm Releases/Lunar$(FULL_VERSION)*.delta || true
"$(SPARKLE_BIN_DIR)/generate_appcast" --maximum-versions 10 --maximum-deltas 2 --major-version "6.0.0" --link "https://lunar.fyi/" --full-release-notes-url "https://lunar.fyi/changelog" --channel "$(CHANNEL)" --release-notes-url-prefix https://files.lunar.fyi/ReleaseNotes/ --download-url-prefix https://files.lunar.fyi/releases/ -o Releases/appcast2.xml Releases
else
rm Releases/Lunar$(FULL_VERSION)*.delta || true
rm Releases/Lunar-*{a,b}*.dmg || true
rm Releases/Lunar*{a,b}*.delta || true
"$(SPARKLE_BIN_DIR)/generate_appcast" --maximum-versions 10 --major-version "6.0.0" --link "https://lunar.fyi/" --full-release-notes-url "https://lunar.fyi/changelog" --release-notes-url-prefix https://files.lunar.fyi/ReleaseNotes/ --download-url-prefix https://files.lunar.fyi/releases/ -o Releases/appcast2.xml Releases
Expand Down
19 changes: 10 additions & 9 deletions Releases/appcast-stable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
<title>Lunar</title>
<item>
<title>6.0.0</title>
<pubDate>Fri, 17 Mar 2023 15:19:07 +0200</pubDate>
<pubDate>Fri, 17 Mar 2023 16:24:07 +0200</pubDate>
<link>https://lunar.fyi/</link>
<sparkle:phasedRolloutInterval>172800</sparkle:phasedRolloutInterval>
<sparkle:fullReleaseNotesLink>https://lunar.fyi/changelog</sparkle:fullReleaseNotesLink>
<sparkle:minimumAutoupdateVersion>6.0.0</sparkle:minimumAutoupdateVersion>
<sparkle:version>6.0.0</sparkle:version>
<sparkle:shortVersionString>6.0.0</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>https://files.lunar.fyi/ReleaseNotes/Lunar-6.0.0.html</sparkle:releaseNotesLink>
<enclosure url="https://files.lunar.fyi/releases/Lunar-6.0.0.dmg" length="21739208" type="application/octet-stream" sparkle:edSignature="Thj3iGgPLUIlhKL1ssTsGcJXohMwCHJgx6H0oIPHdEgD2Zcv+uF43gVxU7yau6tkLdCtBGt6ZxC5e5ypxRPvCw=="/>
<enclosure url="https://files.lunar.fyi/releases/Lunar-6.0.0.dmg" length="21741125" type="application/octet-stream" sparkle:edSignature="cimkFWSiigsnqMFaounK+7mLIo1sYCFJSkiRgCc41uct6wqugGHAPJeLjE8kR2WQ8wQqj42zt9CDZZM1iNNwCg=="/>
<sparkle:deltas>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.5.delta" sparkle:deltaFrom="5.9.5" length="6142294" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="XZ9sKDOBwYDXYuauDVdCyNTXpQjoZd2+objd+Am0XMNdQqT34kXizpQ6f21q+2B8TH2BuAGm3+G9r2UnHqRAAg=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.4.delta" sparkle:deltaFrom="5.9.4" length="6194982" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="L0Is0NZE4Sm8t619pU+fVME6LGPeucVUcn/mQBi96E70/4jumkhz+Dm0awAg/VreaBbKwd2+Ut/xmjofjgzECw=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.3.delta" sparkle:deltaFrom="5.9.3" length="6184618" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="vIOyqt2cVmmABNyqVLr3lF7pb13EUiYK1ZZChpnFdyH1CaZagGc0XP5rbKY94EP+kwOdxsuAKmBAusNAz69LDg=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.1.delta" sparkle:deltaFrom="5.9.1" length="6305570" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="xdEmlX78yAKboihVd3fsrqYWbrNa3iq0iyuITP0hkOON5kyuBdTxTgNnA5DsKwz6rBrbtJSIyTrQnKxwDZXUDQ=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.2.delta" sparkle:deltaFrom="5.9.2" length="6197134" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="dspKEevN4mMX3eo3KyZrkZl2MbRgqC3wxk23Q2uXDhxlHaxJkHzUSLO48Xpjw369qRCWVKpeyAY4Ufh+56MPAQ=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.5.delta" sparkle:deltaFrom="5.9.5" length="6138494" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="VdweW8qzG8v4yw4a1s33iGVQH3pzICFFFu1w+wEw4Dy5uhWYCyzb/fBcNPoGKP/XAfaXjJc1RI+59wXuBP2KDQ=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.1.delta" sparkle:deltaFrom="5.9.1" length="6296486" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="V5TOQc7O7YtohSN6mJ0X99aILjRqiB5sEwYiUaBGW9QjmfvpGm/ke6GUIkquFM66j+phVnrcDWQgtlks79jDDA=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.4.delta" sparkle:deltaFrom="5.9.4" length="6213778" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="3Y1z3B0gjIuvfoXmdMmxy4dfUom34CgZSNrK4dhjpHWSNfUrHWA8hLXOpYKoUCVoxeSDCwfQSbuvi57uVO4SAg=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.3.delta" sparkle:deltaFrom="5.9.3" length="6208754" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="qD2p2/FMBSyMj3sL4F1A/XC0U8sy4H6oczZJ9Imf3HTR9aDSycMr5/Xs9GW1j1ArtaYETHaPe7aMCKxTx8O1CA=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar6.0.0-5.9.2.delta" sparkle:deltaFrom="5.9.2" length="6257162" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="bj8s9setv/tQZgB7cSbd4GnPEL74QLMGJIvAUEwY/BsDMdEqMna5zpiS42mR/DZBk8tlNow7l+c9tDLkT+R5BQ=="/>
</sparkle:deltas>
</item>
<item>
Expand All @@ -33,10 +34,10 @@
<sparkle:releaseNotesLink>https://files.lunar.fyi/ReleaseNotes/Lunar-5.9.5.html</sparkle:releaseNotesLink>
<enclosure url="https://files.lunar.fyi/releases/Lunar-5.9.5.dmg" length="21682338" type="application/octet-stream" sparkle:edSignature="qcOq9SBoIEODDX4Zk7df61kxqPb++P1a1cFW28qtbXIVhcgEUXU8WDpyzQ0gtYnI/hLVy/BSqFide+qRPcxCDA=="/>
<sparkle:deltas>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.3.delta" sparkle:deltaFrom="5.9.3" length="3147494" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="N2r4y0NlYpZZRb5f7ewkBFlrW/LeoIVeAAl4Kry4E4gbuylKbCwrGB9J+RaHKKZ83tAnLbg6TggTkiJSWMDdAQ=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.4.delta" sparkle:deltaFrom="5.9.4" length="3017194" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="bQmhOgbcXSzgeW0Gn2fxrmWFJ+551P8CDd0/z7NBgpI6t+R2c7hqs9LUZgdSuZ9qXjiIe/gqVLwFEI+w97UhAA=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.2.delta" sparkle:deltaFrom="5.9.2" length="3554398" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="vOjubfCbtZcKvkegX2jIjfIwXjXDYnHWfd6MNknAAQY9hUhm9xQoSOBO7V87YswZyiRav/TOOml/gFuvC1bZAg=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.3.delta" sparkle:deltaFrom="5.9.3" length="3147494" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="N2r4y0NlYpZZRb5f7ewkBFlrW/LeoIVeAAl4Kry4E4gbuylKbCwrGB9J+RaHKKZ83tAnLbg6TggTkiJSWMDdAQ=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.1.delta" sparkle:deltaFrom="5.9.1" length="3647930" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="pYBWiuahLp1ufuZ72MUZF57qBXXSXjpTQYVY8rDA88cQ2PTEgRvvRFeaY5MCac7SilBzSkM4yoxhL9jvZFtMCQ=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.2.delta" sparkle:deltaFrom="5.9.2" length="3554398" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="vOjubfCbtZcKvkegX2jIjfIwXjXDYnHWfd6MNknAAQY9hUhm9xQoSOBO7V87YswZyiRav/TOOml/gFuvC1bZAg=="/>
<enclosure url="https://files.lunar.fyi/deltas/Lunar5.9.5-5.9.0.delta" sparkle:deltaFrom="5.9.0" length="3609314" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="1843312" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="fwUgWAbaIpSAnxQ7EWGRBiO5R8FpzzI445aNcg20LLv06r3fGZUOFdyneRta1t4xXUHVfeXa/6QLJ33BxDIPAw=="/>
</sparkle:deltas>
</item>
Expand Down
Loading

0 comments on commit e5c87d2

Please sign in to comment.