New GeckoView instances aren't connected to Gecko when Activity is recreated

RESOLVED FIXED in mozilla28

Status

RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: mfinkle, Assigned: bnicholson)

Tracking

unspecified
mozilla28
x86_64
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Using a test app built with GeckoView:
1. Load web content into test app
2. Rotate device
3. GeckoView goes "white"
4. Attempt to reload content into GeckoView

It fails to load anything.

Comment 1

5 years ago
Maybe caused by 891634?

Comment 2

5 years ago
Maybe caused by bug 891634?
(Assignee)

Comment 3

5 years ago
Created attachment 827586 [details] [diff] [review]
Connect new GeckoView to Gecko after rotation

Rotating recreates the Activity and the GeckoView, so we need to hook the new GeckoView up to Gecko. This now draws the page after rotation, but there's several question/issues that still need to be sorted out:

1) With this patch, I've noticed that after rotating/zooming, touch events are misaligned with where I'm actually touching on the screen.
2) We call GeckoAppShell.registerEventListener() with 'this' as the listener, so the destroyed GeckoView is leaked whenever we rotate. We'll need to figure out a way to unregister these listeners (onDetachedFromWindow?) or decouple them from GeckoView.
3) What happens when we receive events from Gecko while there is no view available (e.g., we're in the middle of a rotation, or we're in the background with "Don't Keep Activities" enabled)? With the current implementation, it's possible that the GeckoView client misses something like Gecko:Ready, and the application becomes borked.
Assignee: nobody → bnicholson
Status: NEW → ASSIGNED
Attachment #827586 - Flags: review?(blassey.bugs)
(Assignee)

Updated

5 years ago
Summary: Rotating app causes GeckoView to lose it's connection to Gecko → New GeckoView instances aren't connected to Gecko when Activity is recreated
Attachment #827586 - Flags: review?(blassey.bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/b2e51c4467a4
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.