WebKitWindowProperties

WebKitWindowProperties — Window properties of a WebKitWebView

Functions

Properties

gboolean fullscreen Read / Write / Construct Only
GdkRectangle * geometry Read / Write / Construct Only
gboolean locationbar-visible Read / Write / Construct Only
gboolean menubar-visible Read / Write / Construct Only
gboolean resizable Read / Write / Construct Only
gboolean scrollbars-visible Read / Write / Construct Only
gboolean statusbar-visible Read / Write / Construct Only
gboolean toolbar-visible Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WebKitWindowProperties

Description

The content of a WebKitWebView can request to change certain properties of the window containing the view. This can include the x, y position of the window, the width and height but also if a toolbar, scrollbar, statusbar, locationbar should be visible to the user, and the request to show the WebKitWebView fullscreen.

The “ready-to-show” signal handler is the proper place to apply the initial window properties. Then you can monitor the WebKitWindowProperties by connecting to ::notify signal.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
static void ready_to_show_cb (WebKitWebView *web_view, gpointer user_data)
{
    GtkWidget *window;
    WebKitWindowProperties *window_properties;
    gboolean visible;

    /* Create the window to contain the WebKitWebView */
    window = browser_window_new ();
    gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (web_view));
    gtk_widget_show (GTK_WIDGET (web_view));

    /* Get the WebKitWindowProperties of the web view and monitor it */
    window_properties = webkit_web_view_get_window_properties (web_view);
    g_signal_connect (window_properties, "notify::geometry",
                      G_CALLBACK (window_geometry_changed), window);
    g_signal_connect (window_properties, "notify::toolbar-visible",
                      G_CALLBACK (window_toolbar_visibility_changed), window);
    g_signal_connect (window_properties, "notify::menubar-visible",
                      G_CALLBACK (window_menubar_vi