[webkit-gtk] WebKit2 FullScreen API

Philippe Normand philn at igalia.com
Tue Jan 10 08:48:39 PST 2012

On Tue, 2012-01-10 at 08:11 -0800, Martin Robinson wrote:
> On Tue, Jan 10, 2012 at 1:02 AM, Philippe Normand <philn at igalia.com> wrote:
> > I've been recently working on WebKit2Gtk FullScreen support[1].
> >
> > I'd like to propose two signals for the WebView in order to cover these
> > aspects of the spec:
> >
> > - Fullscreen should be cancelled if "There is a previously-established
> > user preference, security risk, or platform limitation."
> > - Optionally, display a message indicating how the user can exit
> > displaying the context object fullscreen.
> I think there are a couple important use cases to consider for this API:
> 1. In WebKit2 we have been trying to make the API friendly by doing a
> lot of work for the client in the default signal handlers. For
> examples in WebKit1, the client needed to implement the web inspector
> itself, but now the default signal handler takes care of it.

In this specific case the work is done by a new object attached to the
WebView, called FullScreenController.

> 2. The client should be able to block fullscreen requests and perhaps
> even ask the user and go fullscreen asynchronously.

The blocking is indeed easy to implement for the client and it can also
ask the user's feedback but this would be synchronous, I think. The
entering-fullscreen signal handler could display a GTK dialog and ask
user input but this would block the signal emitter.

> 3. The client should be able to augment entering and leaving
> fullscreen with custom code.

Yes :) That's what I did for the MiniBrowser in my current branch :) The
URL bar is hidden/shown and a GTK Dialog appears, auto-hiding after 2
seconds, like in Chromium.

> From what I can tell your proposal fulfills all three points (though
> perhaps the second part of number 2 easily). Thus, I think your API is
> a good fit.

Thanks Martin for the feedback!

As you asked off-list, I'll have a look at implementing those 2 signals
for WebKit1 too, if it's not too much work.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120110/1afbd9d6/attachment.bin>

More information about the webkit-gtk mailing list