2010-09-14 Martin Robinson <mrobinson@igalia.com>
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Sep 2010 19:19:00 +0000 (19:19 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Sep 2010 19:19:00 +0000 (19:19 +0000)
        Reviewed by Xan Lopez.

        [GTK] fast/events/keydown-numpad-keys.html produces many GLib warnings
        https://bugs.webkit.org/show_bug.cgi?id=45775

        Handle the toggle-overwrite signal on the GtkTextView used for generating editing
        commands. Ignore this signals, as the default handler assumes that the GtkTextView
        has a layout and this one does not.

        * WebCoreSupport/EditorClientGtk.cpp:
        (WebKit::toggleOverwriteCallback): Added. Cancels the default handler.
        (WebKit::EditorClient::EditorClient): Attach a handler for toggle-overwrite.

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

WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp

index 7faa281..7747f27 100644 (file)
@@ -1,3 +1,18 @@
+2010-09-14  Martin Robinson  <mrobinson@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] fast/events/keydown-numpad-keys.html produces many GLib warnings
+        https://bugs.webkit.org/show_bug.cgi?id=45775
+
+        Handle the toggle-overwrite signal on the GtkTextView used for generating editing
+        commands. Ignore this signals, as the default handler assumes that the GtkTextView
+        has a layout and this one does not.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::toggleOverwriteCallback): Added. Cancels the default handler.
+        (WebKit::EditorClient::EditorClient): Attach a handler for toggle-overwrite.
+
 2010-09-14  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index b1973bc..a9c9b00 100644 (file)
@@ -122,6 +122,13 @@ static void pasteClipboardCallback(GtkWidget* widget, EditorClient* client)
     client->addPendingEditorCommand("Paste");
 }
 
+static void toggleOverwriteCallback(GtkWidget* widget, EditorClient* client)
+{
+    // We don't support toggling the overwrite mode, but the default callback expects
+    // the GtkTextView to have a layout, so we handle this signal just to stop it.
+    g_signal_stop_emission_by_name(widget, "toggle-overwrite");
+}
+
 static const char* const gtkDeleteCommands[][2] = {
     { "DeleteBackward",               "DeleteForward"                        }, // Characters
     { "DeleteWordBackward",           "DeleteWordForward"                    }, // Word ends
@@ -770,6 +777,7 @@ EditorClient::EditorClient(WebKitWebView* webView)
     g_signal_connect(m_nativeWidget.get(), "select-all", G_CALLBACK(selectAllCallback), this);
     g_signal_connect(m_nativeWidget.get(), "move-cursor", G_CALLBACK(moveCursorCallback), this);
     g_signal_connect(m_nativeWidget.get(), "delete-from-cursor", G_CALLBACK(deleteFromCursorCallback), this);
+    g_signal_connect(m_nativeWidget.get(), "toggle-overwrite", G_CALLBACK(toggleOverwriteCallback), this);
 }
 
 EditorClient::~EditorClient()