-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
littlexpconnect: Messes up colors #983
Comments
Known issue but I have absolutely no idea how to fix this. I already reduced dependencies (shared libraries) to a minimum but it did not help. What Xpconnect version do you use? |
Intuition says we modify a dataref somewhere, otherwise we should not be able to modify the sims state at all - unless it is an XP bug of course. |
Ok. This is the latest.
Nope. For sure not. My internal code even does not allow this. I'd rather suspect that XP does not like my internal multithreading (all safe according to LR specs and not accessing datarefs from other threads than main loop). You can try to disable |
@albar965 I investigated a bit today. It seems like just creating a QCoreApplication instance leads to this behaviour. I created a very stripped down version of LXP to demonstrate this: https://github.com/maxhille/littlexpconnect . Maybe we can approach LR with this. Is this a Ubuntu/Linux issue only? |
Thank your for demo. The issue appears only on Linux and only with X-Plane 12. No idea for removing QCoreApplication. This will affect a lot of program parts like logging, signals, threads and whatnot. I'll have a look if I can simplify this more. |
Have to see if I can run this without QCoreApplication. |
QCoreApplication docs make it pretty clear that you cannot have multiple instances in one Process and so it makes sense that stuff breaks this way. Do you think it makes sense to talk to LR about this? Are you in their 3rd party dev Slack by any chance? |
Then why does this happen with only one plugin installed? Who is the other Qt user then? LR certainly not. I'll try to get rid of the application instance but I'm not sure if this is doable. Not using Qt is no option since I have to support multiple OS. Have to see. |
Maybe XP uses QT? I don't know.
The behaviour for multiple instances of QCoreApplication is undefined. |
For sure not. Never seen it mentioned. See no library references.
You have a source? |
Maybe it is compiled in statically? If I understand the docs correctly, I can try to check whether QCoreApplication#instance returns something.
|
So for the deeper reason part, I am out of ideas. Maybe @bsupnik can give us a hint?
What part of QT does the plugin need? |
@albar965 Ok I think I found the culprit. I found another plugin which uses QT (ExtPlane) and they have this interesting line and comment at https://github.com/vranki/ExtPlane/blob/master/extplane-plugin/xplaneplugin.cpp#L54 Tested and verified that this does the trick. I guess behind the scenes something like "string to float" or similar got messed up by QT changing the process locale. |
Terrific. 👍 That absolutely makes sense. It can mess up number conversion. I also ran into this already. I'll merge, cherry pick into Thanks a lot! Alex |
This new version 1.0.35 includes your fix: |
Corfirming your build works. |
Thank you both for digging into and discovering that! As a (hobby) Qt user I am reading this with much interest! A little bit down in that stackoverflow thread it is considered ok to set the user's locale on init. So it's a rather obscure problem where X-Plane forgets to set its required locale when it uses it for conversions. It seems nobody expected a plugin (called from the main thread?) to set it to something else. Bad luck I would say ;) Fantastic that you found a workaround for it! |
Hotfix in Avsim forum: https://www.avsim.com/forums/topic/630237-hotfix-for-issues-with-little-xpconnect-x-plane-12-on-linux/ I also attached the modified builds to the 2.8.8 release: https://github.com/albar965/littlenavmap/releases/tag/v2.8.8 Thanks all for the help and big thank you to Max Hille for the fix! |
The LittleXPConnect seems to mess up the colors in my sim, see attached screenshots. The reddish one is with the Plugin installed, the proper/white-ish one without the plugin. This is 100% reproducible for me.
I get that XP12 support might just be accidental at the moment and it might aswell be a bug in the sim. Since I have done some plugin dev myself already I might take a shot at it if I find the time (no promises).
OS: Ubuntu 22.10
NVIDIA-Driver: 525.78.01 (ppa)
X-Plane: 12.01b1
The text was updated successfully, but these errors were encountered: