[Webkit-unassigned] [Bug 75553] [GTK][WK2] Initial FullScreen support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 5 08:07:03 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=75553


Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #121276|1                           |0
        is obsolete|                            |




--- Comment #11 from Carlos Garcia Campos <cgarcia at igalia.com>  2012-01-05 08:07:03 PST ---
(From update of attachment 121276)
View in context: https://bugs.webkit.org/attachment.cgi?id=121276&action=review

> Source/WebKit2/UIProcess/gtk/FullScreenWindowController.cpp:64
> +static gboolean onFullscreenGtkKeyPressEvent(GtkWidget* widget, GdkEventKey* event, FullScreenWindowController* controller)
> +{
> +    switch (event->keyval) {
> +    case GDK_KEY_Escape:
> +    case GDK_KEY_f:
> +    case GDK_KEY_F:
> +        controller->exitFullScreen();

This could be moved to webkitWebViewBaseKeyPressEvent(), checking whether it's in fullscreen or not, probably adding FullScreenWindowController::fullscreenEnabled().

> Source/WebKit2/UIProcess/gtk/FullScreenWindowController.cpp:70
> +    return TRUE;

You should only return TRUE when the event was handled (ESC, f or F was pressed).

> Source/WebKit2/UIProcess/gtk/FullScreenWindowController.cpp:85
> +    GtkWidget* topLevelWindow = gtk_widget_get_toplevel(GTK_WIDGET(m_webViewBase.get()));
> +    if (gtk_widget_is_toplevel(topLevelWindow))
> +        g_signal_connect(topLevelWindow, "key-press-event", G_CALLBACK(onFullscreenGtkKeyPressEvent), this);
> +
> +    gtk_window_fullscreen(GTK_WINDOW(topLevelWindow));

Even using the controller object I still think this should be done in the WebView. webkitWebViewBaseEnterFullScreen().

> Source/WebKit2/UIProcess/gtk/FullScreenWindowController.cpp:97
> +    GtkWidget* topLevelWindow = gtk_widget_get_toplevel(GTK_WIDGET(m_webViewBase.get()));
> +    if (gtk_widget_is_toplevel(topLevelWindow))
> +        g_signal_handlers_disconnect_by_func(topLevelWindow, reinterpret_cast<void*>(onFullscreenGtkKeyPressEvent), this);

You don't need this if you use webkitWebViewBaseKeyPressEvent().

> Source/WebKit2/UIProcess/gtk/FullScreenWindowController.cpp:102
> +    gtk_window_unfullscreen(GTK_WINDOW(topLevelWindow));

Ditto, webkitWebViewBaseExitFullscreen().

> Source/WebKit2/UIProcess/gtk/FullScreenWindowController.h:25
> +#include "GRefPtr.h"

Use <wtf/gobject/GRefPtr.h>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list