<?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>251648</bug_id>
          
          <creation_ts>2023-02-02 16:23:54 -0800</creation_ts>
          <short_desc>Unable to enter fullscreen in Counterstrike (http://game.play-cs.com) in Safari 16.3</short_desc>
          <delta_ts>2023-10-10 10:11:19 -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>New Bugs</component>
          <version>Safari 16</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=262963</see_also>
          <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="Saam Barati">saam</reporter>
          <assigned_to name="Andy Estes">aestes</assigned_to>
          <cc>aestes</cc>
    
    <cc>jer.noble</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1930682</commentid>
    <comment_count>0</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2023-02-02 16:23:54 -0800</bug_when>
    <thetext>http://game.play-cs.com is a website to play counterstrike in the browser. It&apos;s super buggy in Safari:
- It doesn&apos;t have sound
- Fullscreen doesn&apos;t work properly. Safari is constantly entering/exiting full screen every second or so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1930685</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2023-02-02 16:30:45 -0800</bug_when>
    <thetext>(In reply to Saam Barati from comment #0)
&gt; http://game.play-cs.com is a website to play counterstrike in the browser.
&gt; It&apos;s super buggy in Safari:
&gt; - It doesn&apos;t have sound
&gt; - Fullscreen doesn&apos;t work properly. Safari is constantly entering/exiting
&gt; full screen every second or so.

There are lots of bugs around full screen. It seems to work a bit better if you full screen Safari itself using native macOS UI. But if you press the fullscreen button in the game without full screening the macOS app, that&apos;s when I was seeing the above bug.

Now, I just encountered a different bug. If I fullscreen in the macOS Safari window UI, and then press the full screen button in the game, sometimes it&apos;ll kick me out from the desktop that Safari is full screened in, and take me back to the desktop that doesn&apos;t have Safari in it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1930706</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-02-02 17:23:01 -0800</bug_when>
    <thetext>&lt;rdar://problem/104984915&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1930707</commentid>
    <comment_count>3</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2023-02-02 17:29:22 -0800</bug_when>
    <thetext>I’m seeing this in Safari 16.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1930708</commentid>
    <comment_count>4</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2023-02-02 17:35:01 -0800</bug_when>
    <thetext>Saam says:

&quot;It worked properly my first time through, but playing around with entering/exiting made madness ensue. Repro might not be 100%, though whatever it is my machine seems to hit it every time now. I quit and relaunched, and that didn’t fix it.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1945578</commentid>
    <comment_count>5</comment_count>
      <attachid>465694</attachid>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-03-30 17:56:29 -0700</bug_when>
    <thetext>Created attachment 465694
Reduced testcase

Seems like a visibilitychange event is triggered when entering fullscreen, which triggers an event listener on the page that exits fullscreen.

Here is a reduced testcase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983915</commentid>
    <comment_count>6</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2023-10-09 21:20:14 -0700</bug_when>
    <thetext>*** Bug 262939 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983916</commentid>
    <comment_count>7</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2023-10-09 21:25:44 -0700</bug_when>
    <thetext>Re-titling to make this about the fullscreen issue. Let&apos;s track the audio issue in a new bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983918</commentid>
    <comment_count>8</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2023-10-09 21:43:00 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/18883</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984014</commentid>
    <comment_count>9</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2023-10-10 09:24:17 -0700</bug_when>
    <thetext>Hi Saam! Aside from Andy&apos;s PR, why is play-cs.com exiting fullscreen when visibility changes? That means users can&apos;t switch spaces in Mac fullscreen without their game exiting. That&apos;s super annoying!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984016</commentid>
    <comment_count>10</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2023-10-10 09:25:17 -0700</bug_when>
    <thetext>For the audio issue, if play-cs.com makes use of WebAudio, this commit may interest you: https://commits.webkit.org/268047@main</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984027</commentid>
    <comment_count>11</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2023-10-10 10:08:38 -0700</bug_when>
    <thetext>Filed https://bugs.webkit.org/show_bug.cgi?id=262963 to track the audio issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984030</commentid>
    <comment_count>12</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-10 10:11:13 -0700</bug_when>
    <thetext>Committed 269150@main (7e8c765bf94d): &lt;https://commits.webkit.org/269150@main&gt;

Reviewed commits have been landed. Closing PR #18883 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>465694</attachid>
            <date>2023-03-30 17:56:29 -0700</date>
            <delta_ts>2023-03-30 17:56:29 -0700</delta_ts>
            <desc>Reduced testcase</desc>
            <filename>fullscreen-visibilitychange.html</filename>
            <type>text/html</type>
            <size>198</size>
            <attacher name="Tim Nguyen (:ntim)">ntim</attacher>
            
              <data encoding="base64">CjxidXR0b24gb25jbGljaz0iZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LnJlcXVlc3RGdWxsc2Ny
ZWVuKCkiPlJlcXVlc3QgZnVsbHNjcmVlbjwvYnV0dG9uPgo8c2NyaXB0Pgpkb2N1bWVudC5hZGRF
dmVudExpc3RlbmVyKCJ2aXNpYmlsaXR5Y2hhbmdlIiwgKCkgPT57CiAgICBkb2N1bWVudC5leGl0
RnVsbHNjcmVlbigpOwp9KTsKPC9zY3JpcHQ+
</data>

          </attachment>
      

    </bug>

</bugzilla>