<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>135020</bug_id>
          
          <creation_ts>2014-07-17 12:37:13 -0700</creation_ts>
          <short_desc>[Mac] Full screen video not always animating in the correct Space</short_desc>
          <delta_ts>2014-07-17 20:29:48 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>ggaren</cc>
    
    <cc>jer.noble</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1023069</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-07-17 12:37:13 -0700</bug_when>
    <thetext>Entering full-screen video playback mode can get locked to the original space used by the application. Instead, we should make sure our full screen window is part of the current space before entering full screen mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023071</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-07-17 12:42:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/17542310&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023072</commentid>
    <comment_count>2</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-07-17 12:47:14 -0700</bug_when>
    <thetext>The fullscreen window can &quot;remember&quot; the Space it was part of the first time you enter fullscreen mode. Subsequent fullscreen transitions will always start from this Space, even if you move the WebKit-hosted application to a different Space.

We can help the display system know when we&apos;ve moved to a new Space by calling NSWindow&apos;s &quot;orderBack&quot; method on the fullscreen window prior to starting the transition to fullscreen mode. This method call hooks the window into the current Space so everything works properly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023073</commentid>
    <comment_count>3</comment_count>
      <attachid>235085</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-07-17 12:48:24 -0700</bug_when>
    <thetext>Created attachment 235085
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023076</commentid>
    <comment_count>4</comment_count>
      <attachid>235085</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-07-17 13:25:44 -0700</bug_when>
    <thetext>Comment on attachment 235085
Patch

If we orderBack, will the fullscreen animation be occluded in some way by front-more windows? Why not orderWindow:relativeTo: the WebView&apos;s window?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023077</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-07-17 13:26:06 -0700</bug_when>
    <thetext>(or orderFront)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023086</commentid>
    <comment_count>6</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2014-07-17 13:54:22 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 235085 [details])
&gt; If we orderBack, will the fullscreen animation be occluded in some way by front-more windows? Why not orderWindow:relativeTo: the WebView&apos;s window?

We actually still do makeKeyAndOrderFront: as soon as the animation begins.  So this just orders the window on screen slightly earlier.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023094</commentid>
    <comment_count>7</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-07-17 14:07:02 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #4)
&gt; &gt; (From update of attachment 235085 [details] [details])
&gt; &gt; If we orderBack, will the fullscreen animation be occluded in some way by front-more windows? Why not orderWindow:relativeTo: the WebView&apos;s window?
&gt; 
&gt; We actually still do makeKeyAndOrderFront: as soon as the animation begins.  So this just orders the window on screen slightly earlier.

Right. We are just trying to get the Window tied to the right Space when we are prepping to begin the animation. If we do it too late, the animation is tied to the wrong Space and we get bad behavior.

&quot;orderBack&quot; avoids any weird flashing of the fullscreen Window before we are ready for it to be seen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023097</commentid>
    <comment_count>8</comment_count>
      <attachid>235085</attachid>
    <who name="Dean Jackson">dino</who>
    <bug_when>2014-07-17 14:14:31 -0700</bug_when>
    <thetext>Comment on attachment 235085
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235085&amp;action=review

&gt; Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:270
&gt; +    [self.window orderBack: self]; // Make sure the full screen window is part of the correct Space

Nit: .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023110</commentid>
    <comment_count>9</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2014-07-17 14:28:19 -0700</bug_when>
    <thetext>Committed r171197: &lt;http://trac.webkit.org/changeset/171197&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023190</commentid>
    <comment_count>10</comment_count>
      <attachid>235085</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-07-17 20:29:48 -0700</bug_when>
    <thetext>Comment on attachment 235085
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235085&amp;action=review

&gt;&gt; Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:270
&gt;&gt; +    [self.window orderBack: self]; // Make sure the full screen window is part of the correct Space
&gt; 
&gt; Nit: .

No space after the colon.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>235085</attachid>
            <date>2014-07-17 12:48:24 -0700</date>
            <delta_ts>2014-07-17 20:29:48 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-135020-20140717124807.patch</filename>
            <type>text/plain</type>
            <size>2051</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDE3MTE5MykKKysrIFNvdXJjZS9XZWJLaXQyL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIzIEBACisyMDE0LTA3LTE3ICBCcmVudCBG
dWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgorCisgICAgICAgIFtNYWNdIEZ1bGwgc2NyZWVu
IHZpZGVvIG5vdCBhbHdheXMgYW5pbWF0aW5nIGluIHRoZSBjb3JyZWN0IFNwYWNlCisgICAgICAg
IGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMzUwMjAKKyAgICAgICAg
PHJkYXI6Ly9wcm9ibGVtLzE3NTQyMzEwPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAo
T09QUyEpLgorCisgICAgICAgVGhlIGZ1bGxzY3JlZW4gd2luZG93IGNhbiAicmVtZW1iZXIiIHRo
ZSBTcGFjZSBpdCB3YXMgcGFydCBvZiB0aGUgZmlyc3QgdGltZSB5b3UgZW50ZXIgZnVsbHNjcmVl
bgorICAgICAgIG1vZGUuIFN1YnNlcXVlbnQgZnVsbHNjcmVlbiB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ZXN1bWluZyB0
aGUgYXBwCkluZGV4OiBTb3VyY2UvV2ViS2l0Mi9VSVByb2Nlc3MvbWFjL1dLRnVsbFNjcmVlbldp
bmRvd0NvbnRyb2xsZXIubW0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291cmNlL1dlYktpdDIvVUlQcm9jZXNz
L21hYy9XS0Z1bGxTY3JlZW5XaW5kb3dDb250cm9sbGVyLm1tCShyZXZpc2lvbiAxNzExMjMpCisr
KyBTb3VyY2UvV2ViS2l0Mi9VSVByb2Nlc3MvbWFjL1dLRnVsbFNjcmVlbldpbmRvd0NvbnRyb2xs
ZXIubW0JKHdvcmtpbmcgY29weSkKQEAgLTI2Nyw2ICsyNjcsNyBAQCAtICh2b2lkKWJlZ2FuRW50
ZXJGdWxsU2NyZWVuV2l0aEluaXRpYWxGCiAgICAgaWYgKCFfYmFja2dyb3VuZFdpbmRvdykKICAg
ICAgICAgX2JhY2tncm91bmRXaW5kb3cgPSBjcmVhdGVCYWNrZ3JvdW5kRnVsbHNjcmVlbldpbmRv
dyhOU1plcm9SZWN0KTsKIAorICAgIFtzZWxmLndpbmRvdyBvcmRlckJhY2s6IHNlbGZdOyAvLyBN
YWtlIHN1cmUgdGhlIGZ1bGwgc2NyZWVuIHdpbmRvdyBpcyBwYXJ0IG9mIHRoZSBjb3JyZWN0IFNw
YWNlCiAgICAgW1tzZWxmIHdpbmRvd10gZW50ZXJGdWxsU2NyZWVuTW9kZTpzZWxmXTsKIH0KIAo=
</data>
<flag name="review"
          id="259629"
          type_id="1"
          status="+"
          setter="dino"
    />
          </attachment>
      

    </bug>

</bugzilla>