Languages

Menu
Sites
Language
Clock widget doesn't receive click events in some cases (Bug?)

Hello everybody!

 

I'm developing a custom clock widget for Tizen Wearable. I've found that when I change locale on connected Android device, this causes clock widget to reload and after that widget doesn't receive click events (such as window.onclick, document.onclick, someElement.onclick). Seems to be a bug, I've created test case for this.

Here are initial conditions:

  • Samsung Gear 2 Neo (SM-R381)
  • Gear is connected to Samsuns Galaxy SIII Mini (GT-I9300)
  • Test widget is installed to Gear ( here is source code https://bitbucket.org/vshalimov/tizenclickclock/src/0b66253ec93bfb32fb1e26e35cd4e11cd656d699?at=master , you can also find compiled .wgt inside ). This is a simple clock widget with click counter to detect user clicks
  • Gear display timeout is set to 5 minutes (optional, but it makes debug comfortable)

Steps to reproduce

  1. Install test widget into gear, setup test widget as a home screen (clock) default and open home screen
  2. Tap on the widget few times. You should see "clicks 1", "clicks 2", "clicks 3" and so on
  3. On Android device go to Settings - Language and input and change locale for another one
  4. After that you will see widget reloaded (it will disappear for a second, than go back again, and clicks count will return to 0)
  5. Tap on the widget few times. Nothing will change, you'll see no clicks counting
  6. Swype widget left|right to go to Gear menu, than go back
  7. Tap on the widget few times. You should see clicks handling properly.

Expected behaviour - on step 5 I'd like to see clicks working.

In test case clicks are handled via window.onclick, but I got same results for document.onclick and typical click handlers with jQuery

In test case we change language on connected Android device to reproduce the problem, but there some other cases when clicks are not handled (unfortunately, not so well defined) - so language change is not an actual reason, it seems more related to widget reload and/or some android services reload while ConfigurationChange.

Edited by: Vladimir Shalimov on 08 Oct, 2014

Responses

3 Replies
Ivan Tabakov

It's a bug from a long time ago... I don't know what cause it, but you can try the following...

Insert this in the end of your js code - 

        var myWindow = window.open("notExisting.html", "_blank", "width=1, height=1");
        myWindow.close();

Your hack works but then I lost device motion event
 

The widget is losing focus to parent (container launcher) and then it reciever the focus when you do the step 6

It is a system bug