diff options
author | portix <none@none> | 2012-11-10 15:53:29 +0100 |
---|---|---|
committer | portix <none@none> | 2012-11-10 15:53:29 +0100 |
commit | 1f16bf084a48700c8184617d0d5fad7f071f63d6 (patch) | |
tree | 880f9a7fbf177b45a693cb0b03621700cb6dad8a /src | |
parent | 826df17aa118f08cfb1cc00fa1c66036d15a53ca (diff) | |
download | dwb-1f16bf084a48700c8184617d0d5fad7f071f63d6.zip |
Paste primary selection into webview
Diffstat (limited to 'src')
-rw-r--r-- | src/callback.c | 2 | ||||
-rw-r--r-- | src/dwb.c | 20 |
2 files changed, 2 insertions, 20 deletions
diff --git a/src/callback.c b/src/callback.c index 321e1991..91e2bdaa 100644 --- a/src/callback.c +++ b/src/callback.c @@ -167,12 +167,10 @@ callback_key_press(GtkWidget *w, GdkEventKey *e) { dwb_change_mode(NORMAL_MODE, true); ret = false; } -#if 0 else if(e->state == GDK_SHIFT_MASK && e->keyval == GDK_KEY_Insert) { dwb_paste_primary(); return true; } -#endif else if (dwb_eval_override_key(e, CP_OVERRIDE_ALL)) ret = true; else if (mode & INSERT_MODE) { @@ -804,33 +804,17 @@ dwb_set_clipboard(const char *text, GdkAtom atom) { return ret; }/*}}}*/ -#if 0 void dwb_paste_primary() { - char *c_text = NULL; GtkClipboard *p_clip = gtk_widget_get_clipboard(CURRENT_WEBVIEW_WIDGET(), GDK_SELECTION_PRIMARY); if (p_clip == NULL) return; char *p_text = gtk_clipboard_wait_for_text(p_clip); - if (p_text == NULL) - return; - GtkClipboard *c_clip = gtk_widget_get_clipboard(CURRENT_WEBVIEW_WIDGET(), GDK_NONE); - if (c_clip == NULL) - return; - c_text = gtk_clipboard_wait_for_text(c_clip); - gtk_clipboard_set_text(c_clip, p_text, -1); - webkit_web_view_paste_clipboard(CURRENT_WEBVIEW()); - if (c_clip != NULL) { - if (c_text != NULL) - gtk_clipboard_set_text(c_clip, c_text, -1); - else { - // clear clipboard - } + if (p_text != NULL) { + js_call_as_function(FOCUSED_FRAME(), CURRENT_VIEW()->js_base, "pastePrimary", p_text, kJSTypeString, NULL); } g_free(p_text); - g_free(c_text); } -#endif /* dwb_scroll (Glist *gl, double step, ScrollDirection dir) {{{*/ void |