diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2018-05-20 17:55:45 -0700 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2018-05-20 17:55:45 -0700 |
commit | 2da3bf2680168252cae7c835a4cc0c23dafdba17 (patch) | |
tree | 23e1d9d60d68f1f5ead1026831c14137999bc001 /src | |
parent | Merge pull request #608 from kakurasan/xdg-spec (diff) | |
download | redshift-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.m | 17 |
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 |