Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappearing icons from favorites list #2177

Closed
syphyr opened this issue Sep 29, 2023 · 8 comments · Fixed by #2178
Closed

Disappearing icons from favorites list #2177

syphyr opened this issue Sep 29, 2023 · 8 comments · Fixed by #2178
Labels
bug Unexpected behavior

Comments

@syphyr
Copy link
Contributor

syphyr commented Sep 29, 2023

Describe the bug
If I slide my finger on any one of the icons in the favorites list a few times, eventually the icon will disappear and leave a space where it used to exist.

To Reproduce
Steps to reproduce the behavior:

  1. Enable favorites list
  2. Slide finger on icon, without actually selecting it (this may take several times before the icon disappears)

Expected behavior
Icon does not disappear when sliding finger over it

Screenshots
Please add screenshots to help explain your problem. You can upload images directly to Github, please do not use an external website to host your images.

Additional information

  • App version: v3.20.1-35-g4a7d16e9
  • App installed via: (f-droid, Play Store, debug APK): self built

Additional context
Logcat show the following error when the problem occurs:
E WindowManager: Unable to transfer touch focus

@syphyr syphyr added the bug Unexpected behavior label Sep 29, 2023
@syphyr
Copy link
Contributor Author

syphyr commented Sep 29, 2023

This question on stackoverflow is exactly what is happeing when the icon disappears:
https://stackoverflow.com/questions/38866108/android-windowmanager-unable-to-transfer-touch-focus

@syphyr
Copy link
Contributor Author

syphyr commented Sep 29, 2023

Also, I'm not sure if this is related, but I just started seeing this issue after the following commit:
852ead8 (6 days ago) (6 days ago) cancel loading pojos (marunjar)

Edit: Nevermind, I was still able to reproduce the problem without this commit.

@syphyr
Copy link
Contributor Author

syphyr commented Sep 29, 2023

This is the relative android source that is reached when the favorites icon disappears:
https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-7.1.2_r39/services/core/java/com/android/server/wm/Session.java#339

Edit: On Android 7 the relative code is in Session.java and is later moved into WindowManagerService.java on newer versions of Android.

@syphyr
Copy link
Contributor Author

syphyr commented Sep 29, 2023

Since this issue can be difficult to reproduce, perhaps it has something to do with LONG_PRESS_DELAY or MOVE_SENSITIVITY

final int LONG_PRESS_DELAY = 250;

@syphyr
Copy link
Contributor Author

syphyr commented Sep 29, 2023

So far, I am no longer able to reproduce the problem with the following change:
syphyr@b048d53

Perhaps the LONG_PRESS_DELAY should be increased even more than 500ms.

@syphyr
Copy link
Contributor Author

syphyr commented Sep 29, 2023

After reading the Android documentation, the default long press settings are 400ms, 1000ms, and 1500ms.
https://android.googlesource.com/platform/packages/apps/Settings.git/+/master/res/values/arrays.xml#768

I think to be absolutely safe, the middle setting of 1000ms would be best.

syphyr@bd5b899

@marunjar
Copy link
Collaborator

After reading the Android documentation, the default long press settings are 400ms, 1000ms, and 1500ms. https://android.googlesource.com/platform/packages/apps/Settings.git/+/master/res/values/arrays.xml#768

I think to be absolutely safe, the middle setting of 1000ms would be best.

syphyr@bd5b899

Nice finding.

If there is a setting, why not use value from settings instead of fixed value?
https://developer.android.com/reference/android/view/ViewConfiguration#getLongPressTimeout()

@syphyr
Copy link
Contributor Author

syphyr commented Sep 30, 2023

Great Idea! Thank you for the suggestion. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@marunjar @syphyr and others