Skip to content

Commit 6259e83

Browse files
committed
XDR fixes
1 parent 5a80ec7 commit 6259e83

File tree

12 files changed

+94
-60
lines changed

12 files changed

+94
-60
lines changed

.gitsecret/paths/mapping.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Lunar/Resources/eddsa_priv:d079018c2b1c003c9e239ea8f8cc999b7d98adfd0616911ba0263
33
Lunar/Modes/SensorMode.swift:231e4fc567c3925c2153c32cc0452eb9ee84c1789dc82628e2ccddb38c24c025
44
Lunar/Modes/SyncMode.swift:99587e6a44dfd3620f154a34ac83e0a9c0fedc82b778c6cad71bbeacb437864e
55
Lunar/Modes/LocationMode.swift:bef485a1eb39359f19a37599c2fa55fc3a2f448295570f20c7b4e65984a63ec1
6-
Lunar/Data/Pro.swift:bf91c99c5a12d0c19b5b5a887344e2c4cbdab4f9551c8d8f5baf30c0968cffc1
6+
Lunar/Data/Pro.swift:87271fc9df10953cd8ea301bf90e3d364f045a52b9690ca9376c7e5281c5e581
77
Lunar/Modes/ClockMode.swift:d012d1b6cd91d0527ca6d6d00fd5b7742c3671855fba5d43ab31b6413d8afc84
88
Lunar/DDC/DDC2.h:2413c548ce3cc1681316b52486b66769529ae244ec5c76a160cdc190e7236f61
99
Lunar/DDC/DDC2.c:8488fdfb13ca9525e44db616c773eb67f1f1d52dcf83115d7666b0d79bbeef5a

Lunar.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@
13431343
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
13441344
CODE_SIGN_STYLE = Manual;
13451345
COMBINE_HIDPI_IMAGES = YES;
1346-
CURRENT_PROJECT_VERSION = 6.9.7;
1346+
CURRENT_PROJECT_VERSION = 6.9.8;
13471347
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
13481348
DEVELOPMENT_ASSET_PATHS = "";
13491349
DEVELOPMENT_TEAM = "";
@@ -1375,7 +1375,7 @@
13751375
);
13761376
LLVM_LTO = NO;
13771377
MACOSX_DEPLOYMENT_TARGET = 11.0;
1378-
MARKETING_VERSION = 6.9.7;
1378+
MARKETING_VERSION = 6.9.8;
13791379
MTL_ENABLE_DEBUG_INFO = NO;
13801380
OTHER_CODE_SIGN_FLAGS = "";
13811381
PRODUCT_BUNDLE_IDENTIFIER = fyi.lunar.Lunar;
@@ -1409,7 +1409,7 @@
14091409
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
14101410
CODE_SIGN_STYLE = Manual;
14111411
COMBINE_HIDPI_IMAGES = YES;
1412-
CURRENT_PROJECT_VERSION = 6.9.7;
1412+
CURRENT_PROJECT_VERSION = 6.9.8;
14131413
DEVELOPMENT_ASSET_PATHS = "";
14141414
DEVELOPMENT_TEAM = "";
14151415
"DEVELOPMENT_TEAM[sdk=macosx*]" = RDDXV84A73;
@@ -1440,7 +1440,7 @@
14401440
);
14411441
LLVM_LTO = YES;
14421442
MACOSX_DEPLOYMENT_TARGET = 11.0;
1443-
MARKETING_VERSION = 6.9.7;
1443+
MARKETING_VERSION = 6.9.8;
14441444
MTL_ENABLE_DEBUG_INFO = NO;
14451445
OTHER_CODE_SIGN_FLAGS = "--timestamp";
14461446
PRODUCT_BUNDLE_IDENTIFIER = fyi.lunar.Lunar;

Lunar.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lunar/AppDelegate.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, CLLocationManagerDeleg
294294

295295
var wakeObserver: Cancellable?
296296
var screenObserver: Cancellable?
297+
var activationPolicyBeforeModal: NSApplication.ActivationPolicy?
297298

298299
lazy var updater = SPUUpdater(
299300
hostBundle: Bundle.main,
@@ -496,6 +497,19 @@ final class AppDelegate: NSObject, NSApplicationDelegate, CLLocationManagerDeleg
496497
UM.newVersion = update.displayVersionString
497498
}
498499

500+
func standardUserDriverWillShowModalAlert() {
501+
activationPolicyBeforeModal = NSApp.activationPolicy()
502+
NSApp.setActivationPolicy(.regular)
503+
NSApp.activate(ignoringOtherApps: true)
504+
}
505+
506+
func standardUserDriverDidShowModalAlert() {
507+
if let policy = activationPolicyBeforeModal {
508+
NSApp.setActivationPolicy(policy)
509+
activationPolicyBeforeModal = nil
510+
}
511+
}
512+
499513
func standardUserDriverWillFinishUpdateSession() {
500514
// We will dismiss our gentle UI indicator if the user session for the update finishes
501515
UM.newVersion = nil

Lunar/Data/Display.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,8 +1666,8 @@ let AUDIO_IDENTIFIER_UUID_PATTERN = "([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{4})-[0
16661666
p
16671667
.debounce(for: .milliseconds(5000), scheduler: RunLoop.main)
16681668
.sink { [weak self] shouldPause in
1669-
guard let self, shouldPause, ambientLightCompensationEnabledByUser else { return }
1670-
systemAdaptiveBrightness = true
1669+
// guard let self, shouldPause, ambientLightCompensationEnabledByUser else { return }
1670+
// systemAdaptiveBrightness = true
16711671
}.store(in: &observers)
16721672

16731673
return p

Lunar/Data/Pro.swift.secret

9 Bytes
Binary file not shown.

Lunar/ErrorReports.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ private var sleeping = false
188188
lastMainThreadCheckin = Date().timeIntervalSince1970
189189
}
190190
}
191+
RunLoop.main.perform(inModes: [.modalPanel, .eventTracking, .default, .common]) {
192+
appHangStateQueue.async {
193+
lastMainThreadCheckin = Date().timeIntervalSince1970
194+
}
195+
}
191196
}
192197
appHangTimer = timer
193198
timer.resume()

Lunar/Views/OSDWindow.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ extension Color {
234234

235235
// MARK: - BigSurSlider
236236

237+
private final class BindingProxy {
238+
var binding: Binding<Float> = .constant(0)
239+
}
240+
237241
struct BigSurSlider: View {
238242
init(
239243
percentage: Binding<Float>,
@@ -297,7 +301,6 @@ struct BigSurSlider: View {
297301
@Binding var shownValue: Double?
298302

299303
@State var scrollWheelListener: Cancellable?
300-
301304
@State var hovering = false
302305
@State var enableText: String? = nil
303306
@State var lastCursorPosition = NSEvent.mouseLocation
@@ -313,6 +316,7 @@ struct BigSurSlider: View {
313316
var onSettingPercentage: ((Float) -> Void)?
314317

315318
var body: some View {
319+
let _ = { percentageProxy.binding = _percentage }()
316320
GeometryReader { geometry in
317321
let w = geometry.size.width - sliderHeight
318322
let cgPercentage = cap(percentage, minVal: 0, maxVal: 1).cg
@@ -439,6 +443,8 @@ struct BigSurSlider: View {
439443
}
440444
}
441445

446+
@State private var percentageProxy = BindingProxy()
447+
442448
private var sliderWidth: CGFloat = 200
443449
private var sliderHeight: CGFloat = 22
444450

@@ -464,7 +470,7 @@ struct BigSurSlider: View {
464470
}
465471

466472
private func trackScrollWheel() {
467-
guard scrollWheelListener == nil else { return }
473+
scrollWheelListener = nil
468474
scrollWheelListener = NSApp.publisher(for: \.currentEvent)
469475
.filter { event in event?.type == .scrollWheel }
470476
.throttle(for: .milliseconds(20), scheduler: DispatchQueue.main, latest: true)
@@ -495,9 +501,10 @@ struct BigSurSlider: View {
495501
env.draggingSlider = false
496502
}
497503
}
498-
beforeSettingPercentage?(percentage)
499-
percentage = cap(percentage - (delta / 100), minVal: 0, maxVal: 1)
500-
onSettingPercentage?(percentage)
504+
let current = percentageProxy.binding.wrappedValue
505+
beforeSettingPercentage?(current)
506+
percentageProxy.binding.wrappedValue = cap(current - (delta / 100), minVal: 0, maxVal: 1)
507+
onSettingPercentage?(percentageProxy.binding.wrappedValue)
501508
}
502509
}
503510
}

Lunar/Views/ProViews.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,17 @@ struct VersionView: View {
104104

105105
Spacer()
106106

107-
SwiftUI.Button("Check for updates") { updater.checkForUpdates() }
108-
.buttonStyle(FlatButton(
109-
color: Color.white.opacity(0.1),
110-
textColor: Color.white,
111-
horizontalPadding: 6,
112-
verticalPadding: 3
113-
))
114-
.font(.system(size: 10, weight: .semibold))
107+
SwiftUI.Button("Check for updates") {
108+
appDelegate?.statusItemButtonController?.closeMenuBar()
109+
updater.checkForUpdates()
110+
}
111+
.buttonStyle(FlatButton(
112+
color: Color.white.opacity(0.1),
113+
textColor: Color.white,
114+
horizontalPadding: 6,
115+
verticalPadding: 3
116+
))
117+
.font(.system(size: 10, weight: .semibold))
115118
}
116119
Divider().padding(.vertical, 2).opacity(0.5)
117120
HStack(spacing: 2) {

ReleaseNotes/6.9.8.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
- Implement slow ramp up when enabling XDR to avoid washed out colors
66
- Unify XDR and SDR sliders and OSD and approximate the nits value so that it appears in the XDR range as well
77
- Add *"Force keep System Adaptive Brightness disabled"* to the right click menu of each display
8+
9+
10+
## Known issues
11+
12+
- *Check for updates* dialog is unclickable for the first few seconds after the first click on it *(still investigating)*

0 commit comments

Comments
 (0)