Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / remoting / webapp / fullscreen_v1.js
index 052732d..5935e35 100644 (file)
@@ -75,12 +75,19 @@ remoting.FullscreenAppsV1.prototype.removeListener = function(callback) {
   this.eventSource_.removeEventListener(this.kEventName_, callback);
 };
 
-remoting.FullscreenAppsV1.prototype.syncWithMaximize = function(sync) {
-};
-
 /**
  * @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);
 };