Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT6 Positioning won't work with Geoclue v2 #274

Open
ItachiSan opened this issue Mar 11, 2024 · 4 comments · May be fixed by #285
Open

QT6 Positioning won't work with Geoclue v2 #274

ItachiSan opened this issue Mar 11, 2024 · 4 comments · May be fixed by #285

Comments

@ItachiSan
Copy link
Contributor

ItachiSan commented Mar 11, 2024

What happened?

I want to use the automatic location detection mechanism.
Every time that I run the project in VSCode and debug it I face both methods failing.
While I do understand the fallback method failure (429 against the API), I don't understand why I get an error from the QT6 libraries.

I have verified that I have installed qt6-location and qt6-positioning plus geoclue.
Geoclue works since the demo application works as intended.

I tried debugging the location code file and noticed I receive an invalid location (not None) and even when forcing manually a request update, the interaction with the Geoglue library fails.

Version

3.3 & latest Git commit

How did you install Yin & Yang?

Git clone & AUR

What desktop environments are you seeing the problem on?

other

Which plugin causes the issue?

None

What software version do you use?

No response

Relevant log output

No response

@ItachiSan ItachiSan added the bug Something isn't working label Mar 11, 2024
@l0drex
Copy link
Collaborator

l0drex commented Mar 11, 2024

Yeah, I never got that working with Qt6. I once found a web page of Qt6 documenting the progress of porting different stuff from Qt5 to Qt6 and in there was the positioning API marked as pending, so I kept that code in there and added the fallback. I don't really know what the issue is right now, maybe it's a missing implementation in Qt6 or PySide6 or something else.

@l0drex l0drex added bug:upstream and removed bug Something isn't working labels Mar 11, 2024
@ItachiSan
Copy link
Contributor Author

Should we add a bug issue upstream to get the ball rolling then?

@ItachiSan
Copy link
Contributor Author

I am 99% sure it is a local bug and not a QT one.
I wrote a PoC code that actually prints the time:
https://gist.github.com/ItachiSan/c7e9d470ed1ba53673cdc1b48155d8b7

The output on my machine is:

$ python experiments/test_fetch_position.py 
-- Latest location:
[Wed Mar 13 16:49:29 2024] 59° 50' 22.1" N, 13° 8' 44.5" E
-- Manal update:
[Wed Mar 13 16:49:29 2024] 59° 50' 22.1" N, 13° 8' 44.5" E
-- Background location:
[Wed Mar 13 16:49:29 2024] 59° 50' 22.1" N, 13° 8' 44.5" E
[Wed Mar 13 16:50:14 2024] 59° 50' 10.9" N, 13° 8' 44.5" E
Closing after 30 seconds

The actual position is updated only after the app gets in its .exec status.
I guess that the position querying happens in a place that does not have access to the QT loop and thus misses the access to the position.

@ItachiSan
Copy link
Contributor Author

I have code for 2 features, namely:

  1. Icon support for Plasma
  2. Working QT service
    Will push them up soon.

ItachiSan added a commit to ItachiSan/Yin-Yang that referenced this issue Apr 2, 2024
Rather than manually fetching the position, have our background object receive the various updates of the location and magically update the config.

This is because QT needs its loop running in order to have the location working.

Fixes oskarsh#274
@ItachiSan ItachiSan linked a pull request Apr 2, 2024 that will close this issue
ItachiSan added a commit to ItachiSan/Yin-Yang that referenced this issue Jun 3, 2024
Rather than manually fetching the position, have our background object receive the various updates of the location and magically update the config.

This is because QT needs its loop running in order to have the location working.

Fixes oskarsh#274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants