mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
- move a few loops to the main thread (not call main thread from loop)
This commit is contained in:
@@ -65,15 +65,15 @@ internal class Popup: NSView, Popup_p {
|
||||
}
|
||||
|
||||
internal func usageCallback(_ values: [Fan]) {
|
||||
values.forEach { (f: Fan) in
|
||||
if self.list[f.id] != nil {
|
||||
DispatchQueue.main.async(execute: {
|
||||
if self.window?.isVisible ?? false {
|
||||
DispatchQueue.main.async(execute: {
|
||||
if self.window?.isVisible ?? false {
|
||||
values.forEach { (f: Fan) in
|
||||
if self.list[f.id] != nil {
|
||||
self.list[f.id]?.update(f)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,14 +74,14 @@ internal class Popup: NSView, Popup_p {
|
||||
}
|
||||
|
||||
internal func usageCallback(_ values: [Sensor_t]) {
|
||||
values.forEach { (s: Sensor_t) in
|
||||
if self.list[s.key] != nil {
|
||||
DispatchQueue.main.async(execute: {
|
||||
if (self.window?.isVisible ?? false) {
|
||||
DispatchQueue.main.async(execute: {
|
||||
if (self.window?.isVisible ?? false) {
|
||||
values.forEach { (s: Sensor_t) in
|
||||
if self.list[s.key] != nil {
|
||||
self.list[s.key]?.stringValue = s.formattedValue
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>174</string>
|
||||
<string>175</string>
|
||||
<key>Description</key>
|
||||
<string>Simple macOS system monitor in your menu bar</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
||||
Reference in New Issue
Block a user