Index: remoting/webapp/fullscreen_v1.js |
diff --git a/remoting/webapp/fullscreen_v1.js b/remoting/webapp/fullscreen_v1.js |
index 063925b715708a0cb5317be6a56a3715ed55bc3a..5935e3555433988d3c5260063d10f7989b577bb2 100644 |
--- a/remoting/webapp/fullscreen_v1.js |
+++ b/remoting/webapp/fullscreen_v1.js |
@@ -79,5 +79,15 @@ remoting.FullscreenAppsV1.prototype.removeListener = function(callback) { |
* @private |
*/ |
remoting.FullscreenAppsV1.prototype.onFullscreenChanged_ = function() { |
- this.eventSource_.raiseEvent(this.kEventName_, this.isActive()); |
+ // Querying full-screen immediately after the webkitfullscreenchange |
+ // event fires sometimes gives the wrong answer on Mac, perhaps due to |
+ // the time taken to animate presentation mode. Since I haven't been able |
+ // to isolate the exact repro steps, and we're not planning on using this |
+ // API for much longer, this hack will suffice for now. |
+ window.setTimeout( |
+ /** @this {remoting.FullscreenAppsV1} */ |
+ function() { |
+ this.eventSource_.raiseEvent(this.kEventName_, this.isActive()); |
+ }.bind(this), |
+ 500); |
}; |