nonprism.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. diff --git a/meson.build b/meson.build
  2. index ee121983..3493febd 100644
  3. --- a/meson.build
  4. +++ b/meson.build
  5. @@ -101,7 +101,6 @@ gtk_dep = dependency('gtk+-3.0', version: '>= 3.15.3')
  6. gtk_x11_dep = dependency('gtk+-x11-3.0')
  7. gweather_dep = dependency('gweather4')
  8. libcanberra_gtk_dep = dependency('libcanberra-gtk3')
  9. -libgeoclue_dep = dependency('libgeoclue-2.0', version: '>= 2.3.1')
  10. libnotify_dep = dependency('libnotify', version: '>= 0.7.3')
  11. libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', version: '>= 2.0')
  12. pango_dep = dependency('pango', version: '>= 1.20.0')
  13. diff --git a/plugins/color/gcm-self-test.c b/plugins/color/gcm-self-test.c
  14. index e2938614..9c73f152 100644
  15. --- a/plugins/color/gcm-self-test.c
  16. +++ b/plugins/color/gcm-self-test.c
  17. @@ -79,9 +79,6 @@ gcm_test_night_light (void)
  18. datetime_override = g_date_time_new_utc (2017, 2, 8, 20, 0, 0);
  19. gsd_night_light_set_date_time_now (nlight, datetime_override);
  20. - /* do not start geoclue */
  21. - gsd_night_light_set_geoclue_enabled (nlight, FALSE);
  22. -
  23. /* do not smooth the transition */
  24. gsd_night_light_set_smooth_enabled (nlight, FALSE);
  25. diff --git a/plugins/color/gsd-night-light.c b/plugins/color/gsd-night-light.c
  26. index b11f0755..2d21900a 100644
  27. --- a/plugins/color/gsd-night-light.c
  28. +++ b/plugins/color/gsd-night-light.c
  29. @@ -20,8 +20,6 @@
  30. #include "config.h"
  31. -#include <geoclue.h>
  32. -
  33. #define GNOME_DESKTOP_USE_UNSTABLE_API
  34. #include "gnome-datetime-source.h"
  35. @@ -36,11 +34,8 @@ struct _GsdNightLight {
  36. gboolean forced;
  37. gboolean disabled_until_tmw;
  38. GDateTime *disabled_until_tmw_dt;
  39. - gboolean geoclue_enabled;
  40. GSource *source;
  41. guint validate_id;
  42. - GClueClient *geoclue_client;
  43. - GClueSimple *geoclue_simple;
  44. GSettings *location_settings;
  45. gdouble cached_sunrise;
  46. gdouble cached_sunset;
  47. @@ -462,91 +457,6 @@ settings_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
  48. night_light_recheck (self);
  49. }
  50. -static void
  51. -on_location_notify (GClueSimple *simple,
  52. - GParamSpec *pspec,
  53. - gpointer user_data)
  54. -{
  55. - GsdNightLight *self = GSD_NIGHT_LIGHT (user_data);
  56. - GClueLocation *location;
  57. - gdouble latitude, longitude;
  58. -
  59. - location = gclue_simple_get_location (simple);
  60. - latitude = gclue_location_get_latitude (location);
  61. - longitude = gclue_location_get_longitude (location);
  62. -
  63. - g_settings_set_value (self->settings,
  64. - "night-light-last-coordinates",
  65. - g_variant_new ("(dd)", latitude, longitude));
  66. -
  67. - g_debug ("got geoclue latitude %f, longitude %f", latitude, longitude);
  68. -
  69. - /* recheck the levels if the location changed significantly */
  70. - if (update_cached_sunrise_sunset (self))
  71. - night_light_recheck_schedule (self);
  72. -}
  73. -
  74. -static void
  75. -on_geoclue_simple_ready (GObject *source_object,
  76. - GAsyncResult *res,
  77. - gpointer user_data)
  78. -{
  79. - GsdNightLight *self = GSD_NIGHT_LIGHT (user_data);
  80. - GClueSimple *geoclue_simple;
  81. - g_autoptr(GError) error = NULL;
  82. -
  83. - geoclue_simple = gclue_simple_new_finish (res, &error);
  84. - if (geoclue_simple == NULL) {
  85. - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
  86. - g_warning ("Failed to connect to GeoClue2 service: %s", error->message);
  87. - return;
  88. - }
  89. -
  90. - self->geoclue_simple = geoclue_simple;
  91. - self->geoclue_client = gclue_simple_get_client (self->geoclue_simple);
  92. - g_object_set (G_OBJECT (self->geoclue_client),
  93. - "time-threshold", 60*60, NULL); /* 1 hour */
  94. -
  95. - g_signal_connect (self->geoclue_simple, "notify::location",
  96. - G_CALLBACK (on_location_notify), user_data);
  97. -
  98. - on_location_notify (self->geoclue_simple, NULL, user_data);
  99. -}
  100. -
  101. -static void
  102. -start_geoclue (GsdNightLight *self)
  103. -{
  104. - self->cancellable = g_cancellable_new ();
  105. - gclue_simple_new (DESKTOP_ID,
  106. - GCLUE_ACCURACY_LEVEL_CITY,
  107. - self->cancellable,
  108. - on_geoclue_simple_ready,
  109. - self);
  110. -
  111. -}
  112. -
  113. -static void
  114. -stop_geoclue (GsdNightLight *self)
  115. -{
  116. - g_cancellable_cancel (self->cancellable);
  117. - g_clear_object (&self->cancellable);
  118. -
  119. - if (self->geoclue_client != NULL) {
  120. - gclue_client_call_stop (self->geoclue_client, NULL, NULL, NULL);
  121. - self->geoclue_client = NULL;
  122. - }
  123. - g_clear_object (&self->geoclue_simple);
  124. -}
  125. -
  126. -static void
  127. -check_location_settings (GsdNightLight *self)
  128. -{
  129. - if (g_settings_get_boolean (self->location_settings, "enabled") && self->geoclue_enabled)
  130. - start_geoclue (self);
  131. - else
  132. - stop_geoclue (self);
  133. -}
  134. -
  135. void
  136. gsd_night_light_set_disabled_until_tmw (GsdNightLight *self, gboolean value)
  137. {
  138. @@ -616,12 +526,6 @@ gsd_night_light_get_temperature (GsdNightLight *self)
  139. return self->cached_temperature;
  140. }
  141. -void
  142. -gsd_night_light_set_geoclue_enabled (GsdNightLight *self, gboolean enabled)
  143. -{
  144. - self->geoclue_enabled = enabled;
  145. -}
  146. -
  147. gboolean
  148. gsd_night_light_start (GsdNightLight *self, GError **error)
  149. {
  150. @@ -632,10 +536,6 @@ gsd_night_light_start (GsdNightLight *self, GError **error)
  151. g_signal_connect (self->settings, "changed",
  152. G_CALLBACK (settings_changed_cb), self);
  153. - g_signal_connect_swapped (self->location_settings, "changed::enabled",
  154. - G_CALLBACK (check_location_settings), self);
  155. - check_location_settings (self);
  156. -
  157. return TRUE;
  158. }
  159. @@ -644,8 +544,6 @@ gsd_night_light_finalize (GObject *object)
  160. {
  161. GsdNightLight *self = GSD_NIGHT_LIGHT (object);
  162. - stop_geoclue (self);
  163. -
  164. poll_timeout_destroy (self);
  165. poll_smooth_destroy (self);
  166. @@ -791,7 +689,6 @@ gsd_night_light_class_init (GsdNightLightClass *klass)
  167. static void
  168. gsd_night_light_init (GsdNightLight *self)
  169. {
  170. - self->geoclue_enabled = TRUE;
  171. self->smooth_enabled = TRUE;
  172. self->cached_sunrise = -1.f;
  173. self->cached_sunset = -1.f;
  174. diff --git a/plugins/color/gsd-night-light.h b/plugins/color/gsd-night-light.h
  175. index 8803c338..ec1ae7ac 100644
  176. --- a/plugins/color/gsd-night-light.h
  177. +++ b/plugins/color/gsd-night-light.h
  178. @@ -46,8 +46,6 @@ void gsd_night_light_set_forced (GsdNightLight *self,
  179. gboolean value);
  180. /* only for the self test program */
  181. -void gsd_night_light_set_geoclue_enabled (GsdNightLight *self,
  182. - gboolean enabled);
  183. void gsd_night_light_set_date_time_now (GsdNightLight *self,
  184. GDateTime *datetime);
  185. void gsd_night_light_set_smooth_enabled (GsdNightLight *self,
  186. diff --git a/plugins/color/meson.build b/plugins/color/meson.build
  187. index bb05f72f..10379adf 100644
  188. --- a/plugins/color/meson.build
  189. +++ b/plugins/color/meson.build
  190. @@ -11,7 +11,6 @@ sources = files(
  191. deps = plugins_deps + [
  192. colord_dep,
  193. libcanberra_gtk_dep,
  194. - libgeoclue_dep,
  195. libnotify_dep,
  196. libcommon_dep,
  197. m_dep,
  198. diff --git a/plugins/datetime/gsd-timezone-monitor.c b/plugins/datetime/gsd-timezone-monitor.c
  199. index a6e8a48d..52320819 100644
  200. --- a/plugins/datetime/gsd-timezone-monitor.c
  201. +++ b/plugins/datetime/gsd-timezone-monitor.c
  202. @@ -25,7 +25,6 @@
  203. #include "tz.h"
  204. #include "weather-tz.h"
  205. -#include <geoclue.h>
  206. #include <geocode-glib/geocode-glib.h>
  207. #include <polkit/polkit.h>
  208. @@ -45,10 +44,6 @@ typedef struct
  209. GPermission *permission;
  210. Timedate1 *dtm;
  211. - GClueClient *geoclue_client;
  212. - GClueSimple *geoclue_simple;
  213. - GCancellable *geoclue_cancellable;
  214. -
  215. gchar *current_timezone;
  216. GSettings *location_settings;
  217. @@ -262,113 +257,6 @@ on_reverse_geocoding_ready (GObject *source_object,
  218. g_object_unref (place);
  219. }
  220. -static void
  221. -start_reverse_geocoding (GsdTimezoneMonitor *self,
  222. - gdouble latitude,
  223. - gdouble longitude)
  224. -{
  225. - GeocodeLocation *location;
  226. - GeocodeReverse *reverse;
  227. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  228. -
  229. - location = geocode_location_new (latitude,
  230. - longitude,
  231. - GEOCODE_LOCATION_ACCURACY_CITY);
  232. -
  233. - reverse = geocode_reverse_new_for_location (location);
  234. - geocode_reverse_resolve_async (reverse,
  235. - priv->geoclue_cancellable,
  236. - on_reverse_geocoding_ready,
  237. - self);
  238. -
  239. - g_object_unref (location);
  240. - g_object_unref (reverse);
  241. -}
  242. -
  243. -static void
  244. -on_location_notify (GClueSimple *simple,
  245. - GParamSpec *pspec,
  246. - gpointer user_data)
  247. -{
  248. - GsdTimezoneMonitor *self = user_data;
  249. - GClueLocation *location;
  250. - gdouble latitude, longitude;
  251. -
  252. - location = gclue_simple_get_location (simple);
  253. -
  254. - latitude = gclue_location_get_latitude (location);
  255. - longitude = gclue_location_get_longitude (location);
  256. -
  257. - g_debug ("Got location %lf,%lf", latitude, longitude);
  258. -
  259. - start_reverse_geocoding (self, latitude, longitude);
  260. -}
  261. -
  262. -static void
  263. -on_geoclue_simple_ready (GObject *source_object,
  264. - GAsyncResult *res,
  265. - gpointer user_data)
  266. -{
  267. - GError *error = NULL;
  268. - GsdTimezoneMonitorPrivate *priv;
  269. - GClueSimple *geoclue_simple;
  270. -
  271. - geoclue_simple = gclue_simple_new_finish (res, &error);
  272. - if (geoclue_simple == NULL) {
  273. - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
  274. - g_warning ("Failed to connect to GeoClue2 service: %s", error->message);
  275. - g_error_free (error);
  276. - return;
  277. - }
  278. -
  279. - g_debug ("Geoclue now available");
  280. -
  281. - priv = gsd_timezone_monitor_get_instance_private (user_data);
  282. - priv->geoclue_simple = geoclue_simple;
  283. - priv->geoclue_client = gclue_simple_get_client (priv->geoclue_simple);
  284. - gclue_client_set_distance_threshold (priv->geoclue_client,
  285. - GEOCODE_LOCATION_ACCURACY_CITY);
  286. -
  287. - g_signal_connect (priv->geoclue_simple, "notify::location",
  288. - G_CALLBACK (on_location_notify), user_data);
  289. -
  290. - on_location_notify (priv->geoclue_simple, NULL, user_data);
  291. -}
  292. -
  293. -static void
  294. -start_geoclue (GsdTimezoneMonitor *self)
  295. -{
  296. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  297. -
  298. - g_debug ("Timezone monitor enabled, starting geoclue");
  299. -
  300. - priv->geoclue_cancellable = g_cancellable_new ();
  301. - gclue_simple_new (DESKTOP_ID,
  302. - GCLUE_ACCURACY_LEVEL_CITY,
  303. - priv->geoclue_cancellable,
  304. - on_geoclue_simple_ready,
  305. - self);
  306. -
  307. -}
  308. -
  309. -static void
  310. -stop_geoclue (GsdTimezoneMonitor *self)
  311. -{
  312. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  313. -
  314. - g_debug ("Timezone monitor disabled, stopping geoclue");
  315. -
  316. - g_cancellable_cancel (priv->geoclue_cancellable);
  317. - g_clear_object (&priv->geoclue_cancellable);
  318. -
  319. - if (priv->geoclue_client) {
  320. - gclue_client_call_stop (priv->geoclue_client, NULL, NULL, NULL);
  321. - priv->geoclue_client = NULL;
  322. - }
  323. -
  324. - g_clear_object (&priv->geoclue_simple);
  325. -}
  326. -
  327. GsdTimezoneMonitor *
  328. gsd_timezone_monitor_new (void)
  329. {
  330. @@ -383,8 +271,6 @@ gsd_timezone_monitor_finalize (GObject *obj)
  331. g_debug ("Stopping timezone monitor");
  332. - stop_geoclue (monitor);
  333. -
  334. if (priv->cancellable) {
  335. g_cancellable_cancel (priv->cancellable);
  336. g_clear_object (&priv->cancellable);
  337. @@ -416,16 +302,6 @@ gsd_timezone_monitor_class_init (GsdTimezoneMonitorClass *klass)
  338. G_TYPE_NONE, 1, G_TYPE_POINTER);
  339. }
  340. -static void
  341. -check_location_settings (GsdTimezoneMonitor *self)
  342. -{
  343. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  344. - if (g_settings_get_boolean (priv->location_settings, "enabled"))
  345. - start_geoclue (self);
  346. - else
  347. - stop_geoclue (self);
  348. -}
  349. -
  350. static void
  351. gsd_timezone_monitor_init (GsdTimezoneMonitor *self)
  352. {
  353. @@ -466,7 +342,4 @@ gsd_timezone_monitor_init (GsdTimezoneMonitor *self)
  354. priv->current_timezone = timedate1_dup_timezone (priv->dtm);
  355. priv->location_settings = g_settings_new ("org.gnome.system.location");
  356. - g_signal_connect_swapped (priv->location_settings, "changed::enabled",
  357. - G_CALLBACK (check_location_settings), self);
  358. - check_location_settings (self);
  359. }
  360. diff --git a/plugins/datetime/meson.build b/plugins/datetime/meson.build
  361. index ed2d433f..364b6150 100644
  362. --- a/plugins/datetime/meson.build
  363. +++ b/plugins/datetime/meson.build
  364. @@ -20,7 +20,6 @@ sources += gnome.gdbus_codegen(
  365. deps = plugins_deps + [
  366. geocode_glib_dep,
  367. gweather_dep,
  368. - libgeoclue_dep,
  369. libnotify_dep,
  370. m_dep,
  371. polkit_gobject_dep