2007-11-08 Xan Lopez <xan@gnome.org>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2007 23:31:16 +0000 (23:31 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2007 23:31:16 +0000 (23:31 +0000)
        Reviewed by Alp.

        http://bugs.webkit.org/show_bug.cgi?id=15908
        Use g_object_ref_sink when available

        * platform/gtk/PopupMenuGtk.cpp:
        (WebCore::PopupMenu::show):
        * platform/gtk/ScrollViewGtk.cpp:
        (WebCore::ScrollView::setGtkAdjustments):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27618 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/gtk/PopupMenuGtk.cpp
WebCore/platform/gtk/ScrollViewGtk.cpp

index f22aaa07d005a696814e3bcdf1c79edb8b008345..884543bff60e9f1873109c11d912be16522d0b5c 100644 (file)
@@ -1,3 +1,15 @@
+2007-11-08  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Alp.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15908
+        Use g_object_ref_sink when available
+
+        * platform/gtk/PopupMenuGtk.cpp:
+        (WebCore::PopupMenu::show):
+        * platform/gtk/ScrollViewGtk.cpp:
+        (WebCore::ScrollView::setGtkAdjustments):
+
 2007-11-08  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Beth Dakin.
index c1e0ccdb4788bd454d3e45e3e247d0a625ec4693..9443d388513d0f88e15ec2530a5f296deaf3f378 100644 (file)
@@ -50,8 +50,12 @@ void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
 
     if (!m_popup) {
         m_popup = GTK_MENU(gtk_menu_new());
+#if GLIB_CHECK_VERSION(2,10,0)
+        g_object_ref_sink(G_OBJECT(m_popup));
+#else
         g_object_ref(G_OBJECT(m_popup));
         gtk_object_sink(GTK_OBJECT(m_popup));
+#endif
         g_signal_connect(m_popup, "unmap", G_CALLBACK(menuUnmapped), this);
     } else
         gtk_container_foreach(GTK_CONTAINER(m_popup), reinterpret_cast<GtkCallback>(menuRemoveItem), this);
index 209c08f3144a2a17cf828afce14cdbeeba90243b..96a7f52a5e7526acdf98e062c86023ade0cef4ff 100644 (file)
@@ -42,7 +42,6 @@
 #include "Page.h"
 #include "RenderLayer.h"
 
-#include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
 using namespace std;
@@ -279,10 +278,15 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj)
         m_data->setHasVerticalScrollbar(false);
         m_data->setHasHorizontalScrollbar(false);
 
+#if GLIB_CHECK_VERSION(2,10,0)
+        g_object_ref_sink(m_data->horizontalAdjustment);
+        g_object_ref_sink(m_data->verticalAdjustment);
+#else
         g_object_ref(m_data->horizontalAdjustment);
         gtk_object_sink(GTK_OBJECT(m_data->horizontalAdjustment));
         g_object_ref(m_data->verticalAdjustment);
         gtk_object_sink(GTK_OBJECT(m_data->verticalAdjustment));
+#endif
     }
 
     updateScrollbars(m_data->scrollOffset);