BangleApps icon indicating copy to clipboard operation
BangleApps copied to clipboard

[app/widbt_notify] screen not properly cleared after a pop-up

Open idavydov opened this issue 2 years ago • 3 comments

Affected hardware version

Bangle 2

Your firmware version

2v13

The bug

Screen is not properly cleared after widbt_notify popup.

Steps to reproduce

  1. Install widbt_notify.
  2. Run a dummy clock app.
function draw() {
  g.reset();
  g.clearRect(50,50,100,120);
  g.drawString("01:01", 50, 50);
}

g.clear();
draw();
var secondInterval = setInterval(draw, 1000);
  1. Disconnect your watch from bluetooth.

Expected results: pop up appears, and the screen is showing 01:01 in a couple of seconds again.

Actual result: pop up appears, but the screen is not properly cleared.

I suspect the reason for that is how widbt_notify cleans up the screen:

    redrawCurrentApp: function(){
        if(typeof(draw)=='function'){
            draw();
        }else{
            load(); // fallback. This might reset some variables
        }
    },

Do I understand correctly, that widbt_notify is incorrect in assuming that if the app has a draw() function, it will correctly redraw the whole screen?

If this is true, the trivial fix would be just to call load() regardless of the draw() method.

            E.showMessage(/*LANG*/'Connection\nlost.', 'Bluetooth');
            setInterval(()=>{load();}, 3000);

CC @KungPhoo

idavydov avatar May 09 '22 19:05 idavydov