[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:22:24 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 365a9c4a04659534f4a282cc0f454b3de64a4601
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 7 11:34:34 2010 +0000
2010-10-07 Carlos Garcia Campos <cgarcia at igalia.com>
Reviewed by Xan Lopez.
[GTK] Use draw signal instead of expose_event in DragClientGtk when building with gtk3
https://bugs.webkit.org/show_bug.cgi?id=47326
* WebCoreSupport/DragClientGtk.cpp:
(WebKit::dragIconWindowDrawCallback):
(WebKit::DragClient::DragClient):
(WebKit::DragClient::~DragClient):
(WebKit::DragClient::startDrag):
(WebKit::DragClient::dragIconWindowDraw):
* WebCoreSupport/DragClientGtk.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 7656fe3..974e534 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -2,6 +2,21 @@
Reviewed by Xan Lopez.
+ [GTK] Use draw signal instead of expose_event in DragClientGtk when building with gtk3
+ https://bugs.webkit.org/show_bug.cgi?id=47326
+
+ * WebCoreSupport/DragClientGtk.cpp:
+ (WebKit::dragIconWindowDrawCallback):
+ (WebKit::DragClient::DragClient):
+ (WebKit::DragClient::~DragClient):
+ (WebKit::DragClient::startDrag):
+ (WebKit::DragClient::dragIconWindowDraw):
+ * WebCoreSupport/DragClientGtk.h:
+
+2010-10-07 Carlos Garcia Campos <cgarcia at igalia.com>
+
+ Reviewed by Xan Lopez.
+
[GTK] Fix the build for GTK+ 3
https://bugs.webkit.org/show_bug.cgi?id=47249
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index cc75d36..c0550a2 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -41,23 +41,43 @@ using namespace WebCore;
namespace WebKit {
+#ifdef GTK_API_VERSION_2
static gboolean dragIconWindowExposeEventCallback(GtkWidget* widget, GdkEventExpose* event, DragClient* client)
{
client->dragIconWindowExposeEvent(widget, event);
return TRUE;
}
+#else
+static gboolean dragIconWindowDrawCallback(GtkWidget* widget, cairo_t* cr, DragClient* client)
+{
+ GdkRectangle clipRect;
+
+ if (!gdk_cairo_get_clip_rectangle(cr, &clipRect))
+ return FALSE;
+ client->dragIconWindowDraw(widget, cr);
+ return TRUE;
+}
+#endif // GTK_API_VERSION_2
DragClient::DragClient(WebKitWebView* webView)
: m_webView(webView)
, m_startPos(0, 0)
, m_dragIconWindow(gtk_window_new(GTK_WINDOW_POPUP))
{
+#ifdef GTK_API_VERSION_2
g_signal_connect(m_dragIconWindow.get(), "expose-event", G_CALLBACK(dragIconWindowExposeEventCallback), this);
+#else
+ g_signal_connect(m_dragIconWindow.get(), "draw", G_CALLBACK(dragIconWindowDrawCallback), this);
+#endif
}
DragClient::~DragClient()
{
+#ifdef GTK_API_VERSION_2
g_signal_handlers_disconnect_by_func(m_dragIconWindow.get(), (gpointer) dragIconWindowExposeEventCallback, this);
+#else
+ g_signal_handlers_disconnect_by_func(m_dragIconWindow.get(), (gpointer) dragIconWindowDrawCallback, this);
+#endif
}
void DragClient::willPerformDragDestinationAction(DragDestinationAction, DragData*)
@@ -106,9 +126,16 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
if (!gtk_widget_get_realized(m_dragIconWindow.get())) {
GdkScreen* screen = gtk_widget_get_screen(m_dragIconWindow.get());
+#ifdef GTK_API_VERSION_2
GdkColormap* rgba = gdk_screen_get_rgba_colormap(screen);
if (rgba)
gtk_widget_set_colormap(m_dragIconWindow.get(), rgba);
+#else
+ GdkVisual* visual = gdk_screen_get_rgba_visual(screen);
+ if (!visual)
+ visual = gdk_screen_get_system_visual(screen);
+ gtk_widget_set_visual(m_dragIconWindow.get(), visual);
+#endif // GTK_API_VERSION_2
}
IntSize origin = eventPos - dragImageOrigin;
@@ -117,7 +144,7 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
} else
gtk_drag_set_icon_default(context);
}
-
+#ifdef GTK_API_VERSION_2
void DragClient::dragIconWindowExposeEvent(GtkWidget* widget, GdkEventExpose* event)
{
PlatformRefPtr<cairo_t> context = adoptPlatformRef(gdk_cairo_create(event->window));
@@ -128,6 +155,17 @@ void DragClient::dragIconWindowExposeEvent(GtkWidget* widget, GdkEventExpose* ev
cairo_set_source_surface(context.get(), m_dragImage.get(), 0, 0);
cairo_fill(context.get());
}
+#else
+void DragClient::dragIconWindowDraw(GtkWidget* widget, cairo_t* cr)
+{
+ cairo_rectangle(cr, 0, 0,
+ cairo_image_surface_get_width(m_dragImage.get()),
+ cairo_image_surface_get_height(m_dragImage.get()));
+ cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_surface(cr, m_dragImage.get(), 0, 0);
+ cairo_fill(cr);
+}
+#endif // GTK_API_VERSION_2
DragImageRef DragClient::createDragImageForLink(KURL&, const String&, Frame*)
{
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
index 2ab7e2d..30acbc4 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
@@ -54,7 +54,11 @@ namespace WebKit {
virtual void dragControllerDestroyed();
+#ifdef GTK_API_VERSION_2
void dragIconWindowExposeEvent(GtkWidget*, GdkEventExpose*);
+#else
+ void dragIconWindowDraw(GtkWidget*, cairo_t*);
+#endif
private:
WebKitWebView* m_webView;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list