webOS-ports / luneos-testing

Public testing images for LuneOS
3 stars 0 forks source link

ApplicationEvents not Firing #13

Open codepoet80 opened 2 years ago

codepoet80 commented 2 years ago

Describe the bug Enyo supports ApplicationEvents that bubble domEvents to apps. These are used for detecting screen rotation and application relaunches. These ApplicationEvents are not be fired in LuneOS (of if they're fired, apps aren't receiving them), which significantly impact the functionality of some apps.

To Reproduce Steps to reproduce the behavior:

  1. Install Webb Telescope Tracker from App Museum II
  2. Launch and observe a banner notification saying "detecting rotation"
  3. Rotate your physical device, or press F8 to simulate rotation in the emulator
  4. Note that no new banner notification appears
  5. Try the same steps on a webOS device or emulator, note that a banner notification appears any time the device is rotated

Expected behavior As documented here, application events should be raised to any app with an ApplicationEvents kind. http://sdk.webosarchive.com/docs/docs.html#dev-guide/enyo/application-events.html

Additionally, it should be noted that the originating DOM event (window.onresize) is not raised to the app either. The problem may be at the webkit level?

Smartphone (please complete the following information):

Additional Context ApplicationEvents are implemented in dom/ApplicationEvents.js https://sdk.webosarchive.com/api/index.html#dom/ApplicationEvents.js

Herrie82 commented 2 years ago

I doubt that ApplicationEvents completely don't work, since they're used in quite some apps such as Just Type, email etc as per https://github.com/search?p=1&q=org%3Aopenwebos+ApplicationEvents&type=Code.

It could be that some of them (such as luna-systemui) aren't working. Then again I could be wrong of course.

codepoet80 commented 2 years ago

I built a tester app so we can see the missing application events. You can download it here: stacks.webosarchive.org/luneos/com.jonandnic.enyotester_1.0.0_all.ipk

In a quick test, the launch and menu events are firing in LuneOS, but not the relaunch and screen events. The screen grabs attached show the same sequence of actions on a tenderloin running webOS and LuneOS...

Note LuneOS is missing actual rotation events (but firing a spurious rotation event at startup) and the relaunch events. All enyo.ApplicationEvents have been wired up, so if you can figure out a way to invoke them, they can be tested with this app.

webOS-AppEvents

LuneOS-AppEvents

Herrie82 commented 9 months ago

I'm really not sure where these are handled, I don't see any hooks in Open webOS code for these events in any of the browser related stuff, so it seems it's fully Enyo Framework somehow.

codepoet80 commented 9 months ago

Rotation events seem to be working in newer builds. ApplicationRelaunch is still an issue.