Skip to content

fix: prevent duplicated widget rendering on the home screen (issue #320)#360

Open
svenburkard wants to merge 2 commits intoFossifyOrg:mainfrom
svenburkard:bugfix/issue-320-duplicated-widget-rendering-bug
Open

fix: prevent duplicated widget rendering on the home screen (issue #320)#360
svenburkard wants to merge 2 commits intoFossifyOrg:mainfrom
svenburkard:bugfix/issue-320-duplicated-widget-rendering-bug

Conversation

@svenburkard
Copy link

@svenburkard svenburkard commented Feb 8, 2026

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Fixed duplicate home screen widget rendering caused by repeated widget view creation for the same widgetId.
  • Added a guard in both widget-creations to reuse an existing widget view and only update its position/size.
  • This prevents stacked/overlapping/duplicated/unusable widgets reported in Duplicated widget rendering bug #320.

Tests performed

  • Tested with my Pixel 9a (Android 16) with a debug trigger which can be seen inline:
    • forced repeated first-draw widget code via debug intent trigger:
      adb shell am start -n org.fossify.home.debug/org.fossify.home.activities.MainActivity -a org.fossify.home.action.DEBUG_FORCE_WIDGET_FIRST_DRAW
    • verified behavior before/after
    • before: widgets get stacked/overlapping/duplicated/unusable after debug intent trigger
    • after: no stacked/overlapping/duplicated/unusable widget after debug intent triggers anymore

Before & after preview

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

@svenburkard
Copy link
Author

Hi @naveensingh,

I made the bug of #320 reproducible and fixed it with this PR as you can see from the before/after videos.
detect only complains because of my TODO comments, but I kept the related code blocks and comments on intention to make a review easier.

My plan was to remove the related debug code of the TODO comments after the review is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated widget rendering bug

1 participant