elementary / portals

https://elementary.io
GNU General Public License v3.0
23 stars 6 forks source link

Location portal does not work on NixOS when no agent are installed #80

Open bobby285271 opened 1 year ago

bobby285271 commented 1 year ago

What Happened?

(Originally posted in https://github.com/elementary/seeds/issues/100#issuecomment-1562310351)

Since pantheon-agent-geoclue2 is not maintained anymore I am trying to follow the change in NixOS but got stuck.

I am actually trying to do some testing with flatpak com.belmoussaoui.ashpd.demo, for some reasons with the change I can make location requests but no longer can get a LocationUpdated response, this is not the case when I have either pantheon-agent-geoclue2 or geoclue-demo-agent installed (natively). Since ubuntu's geoclue-2.0 package provides geoclue-demo-agent, I am not sure if I should enable that in NixOS also.

We have geoclue 2.7.0 and https://github.com/elementary/default-settings/pull/279, https://github.com/elementary/switchboard-plug-security-privacy/pull/148 are backported when testing.

Steps to Reproduce

  1. Have no agent installed, including the demo one.
  2. flatpak run com.belmoussaoui.ashpd.demo
  3. Go to "location" and click "start session"
  4. Receive no response.

Expected Behavior

Receive LocationUpdated on org.freedesktop.portal.Location

OS Version

Other Linux

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

bobby285271 commented 1 year ago

(I will be surprised if this is not my fault :upside_down_face:)

I tried running the where-am-i program before and after the change. When having agent installed, both GTK_USE_PORTAL=1 where-am-i and where-am-i reports correct location of mine (if that matters).

When having no agent installed, GTK_USE_PORTAL=1 where-am-i reports CRITICAL **: 23:36:57.492: Failed to connect to GeoClue2 service: Start failed and where-am-i reports CRITICAL **: 23:38:07.599: Failed to connect to GeoClue2 service: Timeout was reached.

Marukesu commented 1 year ago

looking at geoclue code, we still need the agent to check if the geolocation was disabled system wide and showing the agent for host process that have a .desktop file but isn't using the location portal. removing the agent seems like a error.