CometVisu / CometVisu

Repository for the CometVisu building automation visualisation.
https://www.cometvisu.org/
Other
63 stars 81 forks source link

Silder in v0.12 breaks with smartphone turning #1369

Open ChristianMayer opened 1 year ago

ChristianMayer commented 1 year ago

Using this very minimal config, version 0.12.4, an Android smartphone and turning the smartphone make troubles using the slider handle. Especially turning from portrait to landscape shows the issue:

Note: in the release version I could see that behavior, in a development build from the release-0.12 branch it's currently working as intended. (Although even there's a little hickup: on the phone the slider moves further than 100%, in the desktop chrome it's working)

<?xml version="1.0" encoding="UTF-8"?>
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lib_version="9" design="metal" xsi:noNamespaceSchemaLocation="../../visu_config.xsd">
  <meta>
    <mappings>
    </mappings>
    <stylings>
    </stylings>
    <plugins>
    </plugins>
  </meta>
  <page name="Minimalbsp"> 
        <slide step="1" format="%d%%">
          <address transform="DPT:5.001" mode="readwrite">1/2/3</address>
        </slide>
  </page>
</pages>
ChristianMayer commented 1 year ago

@peuter right now my analysis of the issue is in a dead end. Could this be a timing issue where the changePageSizeInvalid is sent before the reading of the available space with window.getComputedStyle() is giving the correct number?

peuter commented 1 year ago

Seems like a timing issue, if I just defer the __invalidateScreensize call (in Slide.js constructur) it works for me:

this.__pageSizeListener = cv.ui.layout.ResizeHandler.states.addListener('changePageSizeInvalid', () => {
   (new qx.util.DeferredCall(this.__invalidateScreensize, this)).schedule();
});

(only tested in chrome with device emulation).

Maybe we need another event that is sent when the page size is valid again and you have to listen to that one?

ChristianMayer commented 1 year ago

Documentation is very sparse about browser generated events during and after a page turn and validation.

In the meantime, and as I'm currently suspecting that only 0.12 is affected I created a hotfix that should suffice as a band aid.

peuter commented 1 year ago

In the meantime, and as I'm currently suspecting that only 0.12 is affected I created a hotfix that should suffice as a band aid.

That suspection is wrong, I can easily reproduce the same behaviour with the current development-branch. But my fix also works there, so I assume yours will too. So I suggest to cherry-pick it into the development branch. But there is one additional problem in the dev-branch: Inititialy the slider knob is way too far left (initial value is 100%), the fix does not change that.

ChristianMayer commented 1 year ago

This issue actually caused multiple troubles on my side as the android browser behaved differently than the desktop chrome - and remote debugging of the android browser stopped the input events from working there :astonished:

So it's more a hot fix than a clean fix that solves the underlying timing issue. But it should be easy to cherry pick until there's a real fix.