[Webkit-unassigned] [Bug 17267] [GTK] Primary selection/clipboard support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 28 15:56:01 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=17267





------- Comment #11 from sergio_gcg at hotmail.com  2009-01-28 15:56 PDT -------
(From update of attachment 27129)
>Index: WebKit/gtk/ChangeLog
>===================================================================
>--- WebKit/gtk/ChangeLog	(revision 40327)
>+++ WebKit/gtk/ChangeLog	(working copy)
>@@ -1,3 +1,13 @@
>+2009-01-28  Sergio GarcĂ­a-Cuevas <sergio_gcg at hotmail.com>
>+
>+        https://bugs.webkit.org/show_bug.cgi?id=17267
>+
>+        Implement primary selection support (pasting into editable regions).
>+
>+        * WebCoreSupport/EditorClientGtk.cpp:
>+        (WebKit::EditorClient::buttonPressed):
>+        (WebKit::EditorClient::EditorClient):
>+
> 2009-01-27  Brady Eidson  <beidson at apple.com>
> 
>         Reviewed by Dan Bernstein
>Index: WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
>===================================================================
>--- WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp	(revision 40327)
>+++ WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp	(working copy)
>@@ -37,6 +37,23 @@ using namespace WebCore;
> 
> namespace WebKit {
> 
>+static void buttonPressed(GtkWidget* widget, GdkEventButton* event, EditorClient* client)
>+{
>+    if (event->button == 2 && event->type == GDK_BUTTON_PRESS) {
>+        Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame();
>+        Editor* editor = frame->editor();
>+        if (editor->canPaste()) {
>+            GtkClipboard* clipboard = gtk_widget_get_clipboard(GTK_WIDGET(client->m_webView), GDK_SELECTION_PRIMARY);
>+            gchar* utf8 = gtk_clipboard_wait_for_text(clipboard);
>+            if (utf8) {
>+                String text = String::fromUTF8(utf8);
>+                g_free(utf8);
>+                editor->insertText(text, 0);
>+            }
>+        }
>+    }
>+}
>+
> static void imContextCommitted(GtkIMContext* context, const gchar* str, EditorClient* client)
> {
>     Frame* targetFrame = core(client->m_webView)->focusController()->focusedOrMainFrame();
>@@ -470,6 +490,7 @@ EditorClient::EditorClient(WebKitWebView
>     WebKitWebViewPrivate* priv = m_webView->priv;
>     g_signal_connect(priv->imContext, "commit", G_CALLBACK(imContextCommitted), this);
>     g_signal_connect(priv->imContext, "preedit-changed", G_CALLBACK(imContextPreeditChanged), this);
>+    g_signal_connect_after(m_webView, "button-press-event", G_CALLBACK(buttonPressed), this);
> }
> 
> EditorClient::~EditorClient()


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list