[GTK] Fix PlatformScreen::screenAvailableRect when there's no view widget
https://bugs.webkit.org/show_bug.cgi?id=74520

Reviewed by Martin Robinson.

Use the default screen to get the available screen area instead of
just returning an empty rectangle. This is useful for WebKit2,
since there's no view widget in the web process.

* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenAvailableRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp b/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
index 67d77de..6150b90 100644
--- a/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
+++ b/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
@@ -136,13 +136,14 @@
 
 #if PLATFORM(X11)
     GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformPageClient());
-    if (!container)
-        return FloatRect();
-
-    if (!gtk_widget_get_realized(container))
+    if (container && !gtk_widget_get_realized(container))
         return screenRect(widget);
 
-    GdkWindow* rootWindow = gtk_widget_get_root_window(container);
+    GdkScreen* screen = container ? getScreen(container) : gdk_screen_get_default();
+    if (!screen)
+        return FloatRect();
+
+    GdkWindow* rootWindow = gdk_screen_get_root_window(screen);
     GdkDisplay* display = gdk_window_get_display(rootWindow);
     Atom xproperty = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WORKAREA");