GNOME Bugzilla – Bug 764408
History Dialog is not closeable with Escape
Last modified: 2016-04-02 02:56:44 UTC
Created attachment 325074 [details] [review] patch to fix this Currently its not possible to close the history dialog with Escape if you focused the GtkSearchEntry Widget. Fix in attachment
Review of attachment 325074 [details] [review]: ::: 0001-Removed-functionpointer-assign-from-class.patch @@ +2,3 @@ +From: =?UTF-8?q?G=C3=BCnther=20Wutz?= <info@gunibert.de> +Date: Thu, 31 Mar 2016 12:44:30 +0200 +Subject: [PATCH] Removed functionpointer assign from class Be careful to use 'git status' regularly, to see what you're doing. You've accidentally committed a patch file inside this patch. ;) ::: src/ephy-history-window.c @@ +146,3 @@ } + Let's get rid of this whitespace change (extra blank line). @@ +519,3 @@ +static gboolean +on_search_key_press_event(GtkWidget *widget, OK, this looks like a good solution. Please watch your coding style, make sure to match the style of the surrounding code. In particular: * Two space indentation, not four space * One space before opening parentheses in function definition, function calls, and conditionals * Brace on new line in function definition * Align the parameters (our new style) * It's not strictly required, but I usually leave a blank line after a conditional For example: static gboolean on_search_key_press_event (GtkWidget *widget, GdkEventKey *event, EphyHistoryWindow *self) { if (event->keyval == GDK_KEY_Escape) { g_signal_emit_by_name (self, "close", NULL); return TRUE; } return FALSE; } @@ +524,3 @@ + if(event->keyval == GDK_KEY_Escape) { + g_signal_emit_by_name(self, "close", NULL); + return TRUE; We should use GDK_EVENT_STOP instead of TRUE in new code. @@ +526,3 @@ + return TRUE; + } + return FALSE; GDK_EVENT_PROPAGATE
Created attachment 325129 [details] [review] Fixed Patch Changed coding-style and replaced with constants
Review of attachment 325129 [details] [review]: Almost there: ::: src/ephy-history-window.c @@ +522,3 @@ + EphyHistoryWindow *self) +{ + if(event->keyval == GDK_KEY_Escape) { Need a space before the opening parenthesis here. @@ +523,3 @@ +{ + if(event->keyval == GDK_KEY_Escape) { + g_signal_emit_by_name(self, "close", NULL); And here.
Created attachment 325180 [details] [review] Fixed Patch
Thanks!