From c65af6e247893b808ccce90efc1193a1cf882d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Fri, 11 Apr 2014 07:28:14 +0200 Subject: [PATCH] Try to use DISPLAY=:0 if not in X MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/location-geoclue.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/location-geoclue.c b/src/location-geoclue.c index d4204573..5c027c70 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,