Widget resize frame is drawn off-screen on non-first home screen pages
Describe the bug
On any home screen page other than the first (leftmost), long-pressing a resizable widget and releasing it opens the resize frame, but the frame and its handles aren't visible, so the widget can't be resized. The same widgets resize normally on the first page.
The frame is open (logcat shows LAUNCHER_WIDGET_RESIZE_STARTED and no RESIZE_COMPLETED until dismissed), but it's placed off-screen. dumpsys activity top while the frame is open on page 2:
Workspace 0,0-1080,2400 CellLayout p1 0,151-1080,1999 CellLayout p2 1108,151-2188,1999 <- widget is here, visible on screen at x=44 CellLayout p3 2216,151-3296,1999 AppWidgetResizeFrame 1089,137-2208,669
The screen is 1080px wide. The frame's x (1089) is the widget's on-screen x (~44) plus page 2's offset (1108) minus the frame padding, so the workspace scroll isn't being taken into account when the frame is positioned. The same test on page 1 (calendar widget) puts the frame at -19,137-686,1117, which is correct.
It happens with every widget I tried on non-first pages (Firefox search widget, and another third-party search-bar widget); widgets on page 1 are fine. The stock launcher on the same device resizes these widgets on any page.
Steps to reproduce
- Have at least two home screen pages.
- Place any resizable widget (e.g. Firefox's search widget) on the second page.
- Long-press the widget and release without dragging, to open the resize frame.
- No resize frame or handles appear, and the widget can't be resized.
- Move the same widget to the first page and repeat: the frame and handles appear and resizing works.
Expected behavior
The resize frame and handles appear around the widget on every home screen page, not only the first one.
Screenshots
No response
Device information
- Device: Google Pixel 8a
- OS: stock Android 17 (build 2026091901)
App version
15 Beta 3 (versionCode 1500020300)
Additional context
Workaround: switching the default launcher to another launcher and back lets one resize work on a non-first page, then it breaks again. Resizing on page 1 and dragging the widget to another page also works.
Possibly relevant code (v15.0.0-beta3.0): with ENABLE_WIDGET_TRANSITION_FOR_RESIZING (enabled by default), AppWidgetResizeFrame.getSnappedRectRelativeToDragLayer() positions the frame via getViewPosRelativeToDragLayer(), which saves mWidgetViewWindowPos from mWidgetView.getLocationInWindow() once (and from the CellChildViewPreLayoutListener). The saved position appears to be taken while the workspace scroll doesn't match the visible page. I haven't confirmed exactly when it's captured.
Widget overlap is enabled in Lawnchair settings, in case that matters.
Source: LawnchairLauncher/lawnchair