aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-11 07:28:14 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-11 07:28:14 +0200
commit5ad49f9e49c4aceb42fb1aa2c393b8585cc11b9e (patch)
treeb9e88239c66745b4c2bb4337bef0bde9584a565b /src
parentDo not segfault just because an error has not been given (diff)
downloadredshift-ng-5ad49f9e49c4aceb42fb1aa2c393b8585cc11b9e.tar.gz
redshift-ng-5ad49f9e49c4aceb42fb1aa2c393b8585cc11b9e.tar.bz2
redshift-ng-5ad49f9e49c4aceb42fb1aa2c393b8585cc11b9e.tar.xz
Try to use DISPLAY=:0 if not in X
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/location-geoclue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/location-geoclue.c b/src/location-geoclue.c
index d420457..5c027c7 100644
--- a/src/location-geoclue.c
+++ b/src/location-geoclue.c
@@ -60,6 +60,10 @@ location_geoclue_start(location_geoclue_state_t *state)
state->position = geoclue_position_new(state->provider,
state->provider_path);
} else {
+ if (getenv("DISPLAY") == NULL || *getenv("DISPLAY") == '\0') {
+ /* TODO This (hack) should be removed when GeoClue has been patched. */
+ putenv("DISPLAY=:0");
+ }
GError *error = NULL;
GeoclueMaster *master = geoclue_master_get_default();
GeoclueMasterClient *client = geoclue_master_create_client(master,