threethan / LightningLauncher

App launcher for Oculus Quest and Android TV devices with a focus on speed and flexibility. Thanks for 60K sidequest downloads!
https://sidequestvr.com/app/21783
GNU General Public License v3.0
298 stars 22 forks source link

Bug: after launching some apps, they are unable to be resized #144

Closed natebragg closed 2 weeks ago

natebragg commented 2 months ago

While in LL, I click on an app to launch in a window of its own. For some apps (e.g., termux, firefox, octodroid, ghost commander) resizing is fine. For others (e.g., F-droid, NewPipe, connectbot, VLC, Wireguard, Zoo for Zotero) launched in windows of their own, resizing results in them turning totally black.

Opening these apps in the default window (or others) works fine (I did not test every combination, just enough to be confident that they worked). It's just the "own window" option that does not behave as expected.

All of these apps can be resized without issue when launched from the stock Quest launcher.

Mario-119 commented 1 month ago

Seconding this, have had the same issue for awhile now. Currently on v67 but it's been a thing for much longer than that.

threethan commented 1 month ago

This is an issue with the apps in question, not Lightning Launcher specifically: These apps crash when they are resized.

When opened from the system launcher or dock, they are given a wrapper which reopens them when they crash. This ability is not granted to apps launched by third-party apps such as Lightning Launcher.

It's not a perfect fix, but you can mitigate this issue by settings apps to use a custom window size.

Lightning Launcher gives a similar wrapper to apps launched with a custom size or in the main launcher window. Additionally, the wrapper used by Lightning Launcher will prevent many apps from crashing when resized in the first place.

natebragg commented 1 month ago

I see. What a bummer! Guess I'll have to follow up with each project individually. Given that it's a common cause (resizing), do you have any clue what the fix is? Any example code you can point me to? If I open a ticket with them I'd love to include a patch when possible.

natebragg commented 1 month ago

@threethan just checking, but do you know the answer to this question? If not that's no problem. This ticket can be closed.

threethan commented 2 weeks ago

About time I clarify this. "Crash" was a bit of an oversimplification...

This issue has to do with the android:configChanges manifest value. This defines events like screen rotations and window size changes which the app handles itself. If a change occurs which the app does not explicitly list here, android is supposed to immediately kill the activity, then launch that activity again. Many apps don't declare this, even though they handle resizes perfectly fine.

This activity-restart is often problematic in and of itself, and many android variants opt to just not do it. The Quest implements it in an especially strange way - it kills the activities when the config change occurs, then relies on a special/proprietary panel wrapper provided by VrShell to launch the new activity.

Third-party apps cannot access that wrapper. The custom window size wrapper transfers it's declared configChanges to the child activity, which prevents it from getting killed in the first place.

I'm going to close this issue. It's not really resolved, but the workaround should be sufficient.

(By the way, you'll be able to multitask custom windows in the next major update.)