diff options
author | portix <portix@gmx.net> | 2012-11-22 17:31:16 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-11-22 17:31:16 +0100 |
commit | 58996d0b8304580ebdfec1a0c48525335dd185a2 (patch) | |
tree | ea1a433ad40e4e1ddc339201ccda0700e99cd04e /src/dwb.c | |
parent | e863f00d4f292b9dea57534281a5d0830b34b563 (diff) | |
download | dwb-58996d0b8304580ebdfec1a0c48525335dd185a2.zip |
Always check for Shift-Insert in callback_key_press, fixes ignoring shift-insert in addressbar
Diffstat (limited to 'src/dwb.c')
-rw-r--r-- | src/dwb.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -814,13 +814,31 @@ dwb_paste_into_webview(GtkClipboard *clip, const char *text, GList *gl) js_call_as_function(frame, VIEW(gl)->js_base, "pastePrimary", text, kJSTypeString, NULL); } } +void +dwb_paste_into_entry(GtkClipboard *clip, const char *text) { + char *buffer, *back; + + buffer = back = g_strdup(text); + while (*buffer) { + if (*buffer == '\n' || *buffer == '\r') + *buffer = ' '; + buffer++; + } + entry_insert_text(back); + g_free(back); +} void dwb_paste_primary() { GtkClipboard *p_clip = gtk_widget_get_clipboard(CURRENT_WEBVIEW_WIDGET(), GDK_SELECTION_PRIMARY); if (p_clip == NULL) return; - gtk_clipboard_request_text(p_clip, (GtkClipboardTextReceivedFunc)dwb_paste_into_webview, dwb.state.fview); + if (gtk_widget_has_focus(dwb.gui.entry)) { + gtk_clipboard_request_text(p_clip, (GtkClipboardTextReceivedFunc)dwb_paste_into_entry, NULL); + } + else { + gtk_clipboard_request_text(p_clip, (GtkClipboardTextReceivedFunc)dwb_paste_into_webview, dwb.state.fview); + } } /* dwb_scroll (Glist *gl, double step, ScrollDirection dir) {{{*/ |