Changeset 238492 in webkit


Ignore:
Timestamp:
Nov 26, 2018 6:18:37 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING : drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)
https://bugs.webkit.org/show_bug.cgi?id=150303

Reviewed by Michael Catanzaro.

Ensure gtk has been initialized before trying to get the default display.

  • platform/graphics/PlatformDisplay.cpp:

(WebCore::PlatformDisplay::createPlatformDisplay):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238491 r238492  
     12018-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)
     4        https://bugs.webkit.org/show_bug.cgi?id=150303
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Ensure gtk has been initialized before trying to get the default display.
     9
     10        * platform/graphics/PlatformDisplay.cpp:
     11        (WebCore::PlatformDisplay::createPlatformDisplay):
     12
    1132018-11-26  Javier Fernandez  <jfernandez@igalia.com>
    214
  • trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp

    r238282 r238492  
    4848
    4949#if PLATFORM(GTK)
    50 #include <gdk/gdk.h>
     50#include <gtk/gtk.h>
    5151#endif
    5252
     
    7878    return PlatformDisplayX11::create(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()));
    7979#else
    80     GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
     80    if (gtk_init_check(nullptr, nullptr)) {
     81        GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
    8182#if PLATFORM(X11)
    82     if (GDK_IS_X11_DISPLAY(display))
    83         return PlatformDisplayX11::create(GDK_DISPLAY_XDISPLAY(display));
    84 #endif
    85 #if PLATFORM(WAYLAND)
    86     if (GDK_IS_WAYLAND_DISPLAY(display))
    87         return PlatformDisplayWayland::create(gdk_wayland_display_get_wl_display(display));
    88 #endif
     83        if (GDK_IS_X11_DISPLAY(display))
     84            return PlatformDisplayX11::create(GDK_DISPLAY_XDISPLAY(display));
     85#endif
     86#if PLATFORM(WAYLAND)
     87        if (GDK_IS_WAYLAND_DISPLAY(display))
     88            return PlatformDisplayWayland::create(gdk_wayland_display_get_wl_display(display));
     89#endif
     90    }
    8991#endif
    9092#endif // PLATFORM(GTK)
Note: See TracChangeset for help on using the changeset viewer.