nonprism.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. diff --git a/meson.build b/meson.build
  2. index b03fc403..ade6104e 100644
  3. --- a/meson.build
  4. +++ b/meson.build
  5. @@ -94,7 +94,6 @@ gtk_x11_dep = dependency('gtk+-x11-3.0')
  6. gweather_dep = dependency('gweather-3.0', version: '>= 3.9.5')
  7. lcms_dep = dependency('lcms2', version: '>= 2.2')
  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 7ff01f68..f4308d89 100644
  15. --- a/plugins/color/gcm-self-test.c
  16. +++ b/plugins/color/gcm-self-test.c
  17. @@ -80,9 +80,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 701c7753..d00a78a3 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. @@ -454,91 +449,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. @@ -608,12 +518,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. @@ -624,10 +528,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. @@ -636,8 +536,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. @@ -783,7 +681,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 2ae1740a..45688712 100644
  188. --- a/plugins/color/meson.build
  189. +++ b/plugins/color/meson.build
  190. @@ -15,7 +15,6 @@ deps = plugins_deps + [
  191. gnome_desktop_dep,
  192. lcms_dep,
  193. libcanberra_gtk_dep,
  194. - libgeoclue_dep,
  195. libnotify_dep,
  196. m_dep,
  197. ]
  198. diff --git a/plugins/datetime/gsd-timezone-monitor.c b/plugins/datetime/gsd-timezone-monitor.c
  199. index ca3e6a7f..16493366 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. TzDB *tzdb;
  216. WeatherTzDB *weather_tzdb;
  217. gchar *current_timezone;
  218. @@ -255,113 +250,6 @@ on_reverse_geocoding_ready (GObject *source_object,
  219. g_object_unref (place);
  220. }
  221. -static void
  222. -start_reverse_geocoding (GsdTimezoneMonitor *self,
  223. - gdouble latitude,
  224. - gdouble longitude)
  225. -{
  226. - GeocodeLocation *location;
  227. - GeocodeReverse *reverse;
  228. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  229. -
  230. - location = geocode_location_new (latitude,
  231. - longitude,
  232. - GEOCODE_LOCATION_ACCURACY_CITY);
  233. -
  234. - reverse = geocode_reverse_new_for_location (location);
  235. - geocode_reverse_resolve_async (reverse,
  236. - priv->geoclue_cancellable,
  237. - on_reverse_geocoding_ready,
  238. - self);
  239. -
  240. - g_object_unref (location);
  241. - g_object_unref (reverse);
  242. -}
  243. -
  244. -static void
  245. -on_location_notify (GClueSimple *simple,
  246. - GParamSpec *pspec,
  247. - gpointer user_data)
  248. -{
  249. - GsdTimezoneMonitor *self = user_data;
  250. - GClueLocation *location;
  251. - gdouble latitude, longitude;
  252. -
  253. - location = gclue_simple_get_location (simple);
  254. -
  255. - latitude = gclue_location_get_latitude (location);
  256. - longitude = gclue_location_get_longitude (location);
  257. -
  258. - g_debug ("Got location %lf,%lf", latitude, longitude);
  259. -
  260. - start_reverse_geocoding (self, latitude, longitude);
  261. -}
  262. -
  263. -static void
  264. -on_geoclue_simple_ready (GObject *source_object,
  265. - GAsyncResult *res,
  266. - gpointer user_data)
  267. -{
  268. - GError *error = NULL;
  269. - GsdTimezoneMonitorPrivate *priv;
  270. - GClueSimple *geoclue_simple;
  271. -
  272. - geoclue_simple = gclue_simple_new_finish (res, &error);
  273. - if (geoclue_simple == NULL) {
  274. - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
  275. - g_warning ("Failed to connect to GeoClue2 service: %s", error->message);
  276. - g_error_free (error);
  277. - return;
  278. - }
  279. -
  280. - g_debug ("Geoclue now available");
  281. -
  282. - priv = gsd_timezone_monitor_get_instance_private (user_data);
  283. - priv->geoclue_simple = geoclue_simple;
  284. - priv->geoclue_client = gclue_simple_get_client (priv->geoclue_simple);
  285. - gclue_client_set_distance_threshold (priv->geoclue_client,
  286. - GEOCODE_LOCATION_ACCURACY_CITY);
  287. -
  288. - g_signal_connect (priv->geoclue_simple, "notify::location",
  289. - G_CALLBACK (on_location_notify), user_data);
  290. -
  291. - on_location_notify (priv->geoclue_simple, NULL, user_data);
  292. -}
  293. -
  294. -static void
  295. -start_geoclue (GsdTimezoneMonitor *self)
  296. -{
  297. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  298. -
  299. - g_debug ("Timezone monitor enabled, starting geoclue");
  300. -
  301. - priv->geoclue_cancellable = g_cancellable_new ();
  302. - gclue_simple_new (DESKTOP_ID,
  303. - GCLUE_ACCURACY_LEVEL_CITY,
  304. - priv->geoclue_cancellable,
  305. - on_geoclue_simple_ready,
  306. - self);
  307. -
  308. -}
  309. -
  310. -static void
  311. -stop_geoclue (GsdTimezoneMonitor *self)
  312. -{
  313. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  314. -
  315. - g_debug ("Timezone monitor disabled, stopping geoclue");
  316. -
  317. - g_cancellable_cancel (priv->geoclue_cancellable);
  318. - g_clear_object (&priv->geoclue_cancellable);
  319. -
  320. - if (priv->geoclue_client) {
  321. - gclue_client_call_stop (priv->geoclue_client, NULL, NULL, NULL);
  322. - priv->geoclue_client = NULL;
  323. - }
  324. -
  325. - g_clear_object (&priv->geoclue_simple);
  326. -}
  327. -
  328. GsdTimezoneMonitor *
  329. gsd_timezone_monitor_new (void)
  330. {
  331. @@ -376,8 +264,6 @@ gsd_timezone_monitor_finalize (GObject *obj)
  332. g_debug ("Stopping timezone monitor");
  333. - stop_geoclue (monitor);
  334. -
  335. if (priv->cancellable) {
  336. g_cancellable_cancel (priv->cancellable);
  337. g_clear_object (&priv->cancellable);
  338. @@ -411,16 +297,6 @@ gsd_timezone_monitor_class_init (GsdTimezoneMonitorClass *klass)
  339. G_TYPE_NONE, 1, G_TYPE_POINTER);
  340. }
  341. -static void
  342. -check_location_settings (GsdTimezoneMonitor *self)
  343. -{
  344. - GsdTimezoneMonitorPrivate *priv = gsd_timezone_monitor_get_instance_private (self);
  345. - if (g_settings_get_boolean (priv->location_settings, "enabled"))
  346. - start_geoclue (self);
  347. - else
  348. - stop_geoclue (self);
  349. -}
  350. -
  351. static void
  352. gsd_timezone_monitor_init (GsdTimezoneMonitor *self)
  353. {
  354. @@ -463,7 +339,4 @@ gsd_timezone_monitor_init (GsdTimezoneMonitor *self)
  355. priv->weather_tzdb = weather_tz_db_new ();
  356. priv->location_settings = g_settings_new ("org.gnome.system.location");
  357. - g_signal_connect_swapped (priv->location_settings, "changed::enabled",
  358. - G_CALLBACK (check_location_settings), self);
  359. - check_location_settings (self);
  360. }
  361. diff --git a/plugins/datetime/meson.build b/plugins/datetime/meson.build
  362. index ed2d433f..364b6150 100644
  363. --- a/plugins/datetime/meson.build
  364. +++ b/plugins/datetime/meson.build
  365. @@ -20,7 +20,6 @@ sources += gnome.gdbus_codegen(
  366. deps = plugins_deps + [
  367. geocode_glib_dep,
  368. gweather_dep,
  369. - libgeoclue_dep,
  370. libnotify_dep,
  371. m_dep,
  372. polkit_gobject_dep