Yin-Yang icon indicating copy to clipboard operation
Yin-Yang copied to clipboard

QT6 Positioning won't work with Geoclue v2

Open ItachiSan opened this issue 1 year ago • 4 comments

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 avatar Mar 11 '24 18:03 ItachiSan

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 avatar Mar 11 '24 18:03 l0drex

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

ItachiSan avatar Mar 12 '24 11:03 ItachiSan

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 avatar Mar 13 '24 15:03 ItachiSan

I have code for 2 features, namely:

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

ItachiSan avatar Mar 15 '24 17:03 ItachiSan