- move a few loops to the main thread (not call main thread from loop)

This commit is contained in:
Serhiy Mytrovtsiy
2020-11-26 15:39:36 +01:00
parent 91c32d8ad2
commit 2876fddc4f
3 changed files with 13 additions and 13 deletions

View File

@@ -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)
}
})
}
}
}
})
}
}

View File

@@ -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
}
})
}
}
}
})
}
}

View File

@@ -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>