2012-02-20 Martin Robinson <mrobinson@igalia.com>
+ Fix GTK+ unit tests after r108278.
+
+ Reviewed by Alejandro G. Castro.
+
+ Now that WebCore is no longer stealing focus, we need to
+ adjust where we grab focus to ensure that it actually succeeds.
+
+ * tests/testcopyandpaste.c:
+ (map_event_cb): No longer grab focus here.
+ (runPasteTestCallback): Grabbing focus here seems to be late enough in the process.
+
+2012-02-20 Martin Robinson <mrobinson@igalia.com>
+
[GTK] Web content oftens steals focus from other widgets
https://bugs.webkit.org/show_bug.cgi?id=77791
gboolean map_event_cb(GtkWidget *widget, GdkEvent* event, gpointer data)
{
- gtk_widget_grab_focus(widget);
CopyAndPasteFixture* fixture = (CopyAndPasteFixture*)data;
webkit_web_view_load_string(fixture->webView, fixture->info->page,
"text/html", "utf-8", "file://");
static CopyAndPasteFixture* currentFixture;
static JSValueRef runPasteTestCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
+ gtk_widget_grab_focus(GTK_WIDGET(currentFixture->webView));
+
// Simulate a paste keyboard sequence.
GdkEvent* event = gdk_event_new(GDK_KEY_PRESS);
event->key.keyval = gdk_unicode_to_keyval('v');