From 3eb7d19ebd4ffdf4287d24eb56793042b9bf8234 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Tue, 5 Nov 2024 17:56:46 +0100 Subject: [PATCH] backswipe: change to prepend swipe listener (WIP) Seems to mitigate some conflicts when switching between `edgeclk` (with seconds active) and `dtlaunch`. Sometimes the seconds redraw timeout of `edgeclk` would draw over `dtlaunch`. --- apps/backswipe/ChangeLog | 5 ++--- apps/backswipe/boot.js | 3 ++- apps/backswipe/metadata.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/backswipe/ChangeLog b/apps/backswipe/ChangeLog index 4e81269fe2..c67453a09f 100644 --- a/apps/backswipe/ChangeLog +++ b/apps/backswipe/ChangeLog @@ -1,6 +1,5 @@ 0.01: New App! 0.02: Don't fire if the app uses swipes already. 0.03: Only count defined handlers in the handler array. -0.04: Fix messages auto opened by `messagegui` could not be blacklisted. Needs - a refresh by deselecting and reselecting the "Messages" app throught Back Swipe - settings. +0.04: Fix messages auto opened by `messagegui` could not be blacklisted. Needs a refresh by deselecting and reselecting the "Messages" app throught Back Swipe settings. +0.05: React on swipes before the active app (for the most part) by using `prependListener`. diff --git a/apps/backswipe/boot.js b/apps/backswipe/boot.js index 8ff277634d..cbc0f2563d 100644 --- a/apps/backswipe/boot.js +++ b/apps/backswipe/boot.js @@ -38,6 +38,7 @@ // if we're in an app that has a back button, run the callback for it if (global.BACK && countHandlers("swipe")<=settings.standardNumSwipeHandlers && countHandlers("drag")<=settings.standardNumDragHandlers) { global.BACK(); + E.stopEventPropagation(); } } } @@ -56,5 +57,5 @@ } // Listen to left to right swipe - Bangle.on("swipe", goBack); + Bangle.prependListener("swipe", goBack); })(); diff --git a/apps/backswipe/metadata.json b/apps/backswipe/metadata.json index 4324286b54..78cd4dbe5c 100644 --- a/apps/backswipe/metadata.json +++ b/apps/backswipe/metadata.json @@ -1,7 +1,7 @@ { "id": "backswipe", "name": "Back Swipe", "shortName":"BackSwipe", - "version":"0.04", + "version":"0.05", "description": "Service that allows you to use an app's back button using left to right swipe gesture", "icon": "app.png", "tags": "back,gesture,swipe",