GNOME Bugzilla – Bug 671195
Improve Fullscreen support
Last modified: 2012-06-23 21:41:17 UTC
Since WebKitGtk 1.7.90 the WebView has two new signals: entering-fullscreen and leaving-fullscreen. These signals are emitted when the user requests full screen display for a specific HTML element and also when he clicks on the fullscreen button of the <video> element controls. For more details see the spec: http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html I'd like to integrate this new feature in ephy-window. When the entering-fullscreen signal is emitted we should somehow ask the user's approval and remember about his choice in a white-list. The user can deny or accept full screen display at this stage. Once the window switched to full screen display we should inform the user how to exit from this display mode (escape and f on the keyboard work for instance).
Chromium displays 2 very minimalistic popups, the first one to ask user permission with 2 buttons (allow/deny) and one to notify the user of the display change (example: "Vimeo is now full screen, Exit full screen (Esc)"). The "Exit full screen" is actually a link, so the user has a chance to click on it. You can test this with Chromium 17, at least.
Jon, Jakub, do you have any suggestions for the UI/UX design of this? Otherwise I'll cook something simple. I want at least basic support for this to be in 3.6. First things that come to mind: - how to display the notification (overlayed/popup/message area/etc) - whether to go fullscreen before/after the user confirmation - etc..
Why do we need to ask for permission for going fullscreen?
http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#security-and-privacy-considerations
I think that is a misunderstanding of the spec to be honest. What is required here is indicating what happened and allowing it to be changed not asking for permission up front. That seems really annoying and something we avoid in GNOME "Are you sure? (y/n)". And even that doesn't really apply when the user explicitly asks for fullscreen. So, I think we should do something like this: * Animate the transition to fullscreen to make it clear what is going on * Show the overlay toolbar at the top of the screen for a moment after the animation is complete * Show a leave fullscreen action in that toolbar * Hide the toolbar if the user clicks in the window content or after a second or two * Show the toolbar if the user goes to the top of the screen or maybe depending on the content if the user clicks on the content (eg. video)
I would go only with ESC to leave full-screen mode; 'f' is not a good choice because it can easily be entered if the web site has an input field or if it is somehow monitoring key presses, and furthermore it is a mnemonic that only really works in English. Firefox shows a large banner ("Press ESC to leave full-screen mode") and dims the content for ~5 seconds. The user does not need to acknowledge a modal dialog before continuing. This might be a good compromise between informing the user and not being too disruptive. Philippe's idea of asking at least once for each site looks reasonable as well. A possible approach might be to show a dialog the first time that you enter f-s mode from a given site, plus a small reminder afterwards. Just showing the banner might work as well (and be less intrusive), whereas showing a modal dialog for every full-screen YouTube video looks like overkill. Looking at the issue of an user not knowing how to get out of full-screen mode, another option could be to leave f-s if the user opens the Overview. I am thinking of a confused user trying to leave f-s but not remembering to press ESC. In that scenario, launching the Overview looks like a reasonably likely thing to try, if only because it is a very common action in GNOME 3 (far more likely than Ctrl-W or other shortcuts, in any case). Something like: - user can't leave f-s mode - user tries opening the Overview - Ephy leaves f-s mode - user goes back to Ephy from the Overview, all is normal again This would have the additional benefit of providing a way to leave f-s using only the mouse (albeit a convoluted one). (Btw, should there be a way to do this on a touch screen?) TL;DR: I am leaning towards the following: - show an overlay banner whenever a web app goes full-screen - leave full-screen mode if user opens Overview
Created attachment 216095 [details] [review] ephy-window: keep track of whether the downloads box is shown
Created attachment 216096 [details] [review] ephy-window: hide all chrome when entering html5 fullscreen mode We keep track of the state of the chrome before entering fullscreen mode in order to restore it afterwards. Also force hiding of notebook tabs and hide the downloads box. This is restored afterwards when leaving the fullscreen mode.
Created attachment 216097 [details] [review] ephy-embed: show a message popup when entering html5 fullscreen mode
There's a screencast here: http://people.gnome.org/~csaavedra/epiphany-html5-fullscreen.webm
Review of attachment 216095 [details] [review]: Why not make this an EPHY_WEB_VIEW_CHROME_DOWNLOADS_BOX flag, and hook it into the get_chromes_visibility stuff?
Review of attachment 216096 [details] [review]: ::: src/ephy-window.c @@ +2269,3 @@ + + sync_chromes_visibility (window); + gtk_notebook_set_show_tabs (window->priv->notebook, FALSE); It seems sync_chrome_visibility should somewhat handle this already? @@ +2270,3 @@ + sync_chromes_visibility (window); + gtk_notebook_set_show_tabs (window->priv->notebook, FALSE); + gtk_widget_hide (window->priv->downloads_box); As suggested it seems nicer to just make the sync method take care of everything.
Review of attachment 216097 [details] [review]: ::: src/resources/epiphany.css @@ +29,3 @@ + border-radius: 7px; + border-color: black; +} Probably worth poking the design guys (mostly Lapo) about this.
Created attachment 216791 [details] [review] ephy-window: remove ephy-fullscreen-popup We're no longer using it
Created attachment 216792 [details] [review] ephy-window: keep track of whether the downloads box is shown We add it to EphyWebViewChrome and track it there.
Created attachment 216793 [details] [review] ephy-window: hide all chrome when entering fullscreen mode We keep track of the state of the chrome before entering fullscreen mode in order to restore it afterwards. Also, force hiding of notebook tabs, since EphyNotebook is ubersmart about it. When leaving fullscreen mode, restore to the previous state.
Created attachment 216794 [details] [review] ephy-embed: show a message popup when entering fullscreen mode The message is different depending on whether we are entering HTML5 fullscreen mode or application fullscreen, since the keys used to leave either mode are different.
Review of attachment 216791 [details] [review]: Woot.
Review of attachment 216792 [details] [review]: Looks good.
Review of attachment 216793 [details] [review]: Hrm, I still don't like this very much. There should be a way to tell EphyNotebook "Hide the tabs now. Really, just do it." without leaking stuff into EphyWindow. One odd thing about the ephy_notebook_set_show_tabs method is that the bool parameter that is passed is not used later in the actual computation of the tabs visibility (unless I'm missing something here), so it seems this is somewhat broken/weird.
Review of attachment 216794 [details] [review]: ::: embed/ephy-embed.c @@ +304,3 @@ + + if (embed->priv->fullscreen_message_id) + g_source_remove (embed->priv->fullscreen_message_id); If this is TRUE does it mean the label is already shown? Isn't adding a new timeout 5 seconds later to hide it sort of wrong? I think we should just exit if the message ID is not 0, unless I'm confused. @@ +705,3 @@ gtk_container_add (GTK_CONTAINER (overlay), scrolled_window); + /* floating message bar for html5 fullscreen */ Nitpick, proper capitalization and period at the end.
(In reply to comment #20) > Review of attachment 216793 [details] [review]: > > Hrm, I still don't like this very much. There should be a way to tell > EphyNotebook "Hide the tabs now. Really, just do it." without leaking stuff > into EphyWindow. One odd thing about the ephy_notebook_set_show_tabs method is > that the bool parameter that is passed is not used later in the actual > computation of the tabs visibility (unless I'm missing something here), so it > seems this is somewhat broken/weird. Agreed, so I fixed now this property in bug 678468. A new, much simpler, patch follows. (In reply to comment #21) > Review of attachment 216794 [details] [review]: > > ::: embed/ephy-embed.c > @@ +304,3 @@ > + > + if (embed->priv->fullscreen_message_id) > + g_source_remove (embed->priv->fullscreen_message_id); > > If this is TRUE does it mean the label is already shown? Isn't adding a new > timeout 5 seconds later to hide it sort of wrong? I think we should just exit > if the message ID is not 0, unless I'm confused. This is for the cases when you go quickly from application-fullscreen to HTML5 fullscreen, so that the popup "Press ESC to leave" is shown long enough. Otherwise you risk showing it for a few seconds only. Basically, to restart the timeout when reentering fullscreen for whatever reason. > > @@ +705,3 @@ > gtk_container_add (GTK_CONTAINER (overlay), scrolled_window); > > + /* floating message bar for html5 fullscreen */ > > Nitpick, proper capitalization and period at the end. Sure.
Attachment 216791 [details] pushed as 8f4b964 - ephy-window: remove ephy-fullscreen-popup Attachment 216792 [details] pushed as 6c69d49 - ephy-window: keep track of whether the downloads box is shown
Created attachment 216822 [details] [review] ephy-window: hide all chrome when entering fullscreen mode We keep track of the state of the chrome before entering fullscreen mode in order to restore it afterwards. Also, set tabs-allowed to FALSE in the EphyNotebook when in fullscreen mode. When leaving fullscreen mode, restore to the previous state.
Review of attachment 216822 [details] [review]: Looks good!
(In reply to comment #22) > This is for the cases when you go quickly from application-fullscreen to HTML5 > fullscreen, so that the popup "Press ESC to leave" is shown long enough. > Otherwise you risk showing it for a few seconds only. Basically, to restart the > timeout when reentering fullscreen for whatever reason. > OK, let me put it in another way. What's the scenario exactly in which ephy_embed_entering_fullscreen can be called, with the message shown (so gtk_widget_show has been called on it) and the timeout set to hide it, and where it makes sense to reset the timeout so it stays there for 5 more seconds? My idea would be to do nothing, so that the message is shown for 5 seconds in total, not 5 + whatever amount of time the message had been shown up to that point. Does this make sense?
The following is the scenario: if you go from windowed mode to application fullscreen (via F11) in youtube, for instance, youtube will put the video in its widest non-fullscreen mode. We display the "Press F11 to leave fullscreen" for 5 seconds. If before those 5 seconds are gone you press the "Fullscreen" button in the youtube video, we enter the HTML5 fullscreen, with the video fullscreened. If we don't reset the timeout, what happens is that the banner, now updated with "Press ESC to leave fullscreen" is only shown for whatever time was left, which could be only one or less than a second, which is not enough for the user to read the new message.
Review of attachment 216794 [details] [review]: OK. I'm starting to think this whole thing of ESC vs. F11 depending on what kind of fs mode you are in exactly kinda sucks TBH.
(In reply to comment #28) > OK. I'm starting to think this whole thing of ESC vs. F11 depending on what > kind of fs mode you are in exactly kinda sucks TBH. I agree but we're kinda stuck here for now as there doesn't seem to be a way to tell wk to html5-unfullscreen at will. Also, Escape is already bound to stop loading, so using it also for unfullscreen when browsing in fullscreen mode is sort of odd.
(In reply to comment #29) > I agree but we're kinda stuck here for now as there doesn't seem to be a way to > tell wk to html5-unfullscreen at will. Also, Escape is already bound to stop > loading, so using it also for unfullscreen when browsing in fullscreen mode is > sort of odd. It's not *that* odd. Historically, Netscape bound Esc to 'stop animations' whenever the page was fully loaded. Not sure if Firefox still does this, though. In any case, overloading Esc to mean something different when the page is not in loading state, has been done before.