aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2018-05-20 17:55:45 -0700
committerJon Lund Steffensen <jonlst@gmail.com>2018-05-20 17:55:45 -0700
commit2da3bf2680168252cae7c835a4cc0c23dafdba17 (patch)
tree23e1d9d60d68f1f5ead1026831c14137999bc001 /src
parentMerge pull request #608 from kakurasan/xdg-spec (diff)
downloadredshift-ng-2da3bf2680168252cae7c835a4cc0c23dafdba17.tar.gz
redshift-ng-2da3bf2680168252cae7c835a4cc0c23dafdba17.tar.bz2
redshift-ng-2da3bf2680168252cae7c835a4cc0c23dafdba17.tar.xz
Fix issue where quartz did not mark as unavailable
Diffstat (limited to 'src')
-rw-r--r--src/location-corelocation.m17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/location-corelocation.m b/src/location-corelocation.m
index 1a04d54..10d7acd 100644
--- a/src/location-corelocation.m
+++ b/src/location-corelocation.m
@@ -89,6 +89,17 @@ typedef struct {
pipeutils_signal(self.state->pipe_fd_write);
}
+- (void)markUnavailable
+{
+ [self.state->lock lock];
+
+ self.state->available = 0;
+
+ [self.state->lock unlock];
+
+ pipeutils_signal(self.state->pipe_fd_write);
+}
+
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations
{
@@ -110,7 +121,11 @@ typedef struct {
{
fprintf(stderr, _("Error obtaining location from CoreLocation: %s\n"),
[[error localizedDescription] UTF8String]);
- [self markError];
+ if ([error code] == kCLErrorDenied) {
+ [self markError];
+ } else {
+ [self markUnavailable];
+ }
}
- (void)locationManager:(CLLocationManager *)manager