From d7fad7b75d0006abc0678468227b299841da3320 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 21 Apr 2011 15:49:54 +0000 Subject: [PATCH] Fix behavior of the "CTRL+U" keyboard shortcut --- src/surfer.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/surfer.c b/src/surfer.c index fef4a32..2e52ca0 100644 --- a/src/surfer.c +++ b/src/surfer.c @@ -16,7 +16,8 @@ static char const _license[] = "along with this program. If not, see ."; /* FIXME: * - implement a default download directory (and "always ask") - * - add "new tab" and "new window" buttons to the embedded interface */ + * - add "new tab" and "new window" buttons to the embedded interface + * - consider using GtkSourceView to display the page source */ @@ -1597,6 +1598,13 @@ void surfer_view_source(Surfer * surfer) char const * source; size_t len; + /* XXX this assumes the keyboard shortcut was used */ + widget = gtk_bin_get_child(GTK_BIN(surfer->lb_path)); + if(gtk_window_get_focus(GTK_WINDOW(surfer->window)) == widget) + { + gtk_entry_set_text(GTK_ENTRY(widget), ""); + return; + } if((widget = surfer_get_view(surfer)) == NULL) return; if((url = ghtml_get_location(widget)) == NULL)