After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764408 - History Dialog is not closeable with Escape
History Dialog is not closeable with Escape
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-31 10:56 UTC by Günther Wutz
Modified: 2016-04-02 02:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix this (3.62 KB, patch)
2016-03-31 10:56 UTC, Günther Wutz
none Details | Review
Fixed Patch (2.10 KB, patch)
2016-04-01 07:05 UTC, Günther Wutz
none Details | Review
Fixed Patch (2.10 KB, patch)
2016-04-01 18:28 UTC, Günther Wutz
committed Details | Review

Description Günther Wutz 2016-03-31 10:56:25 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
Comment 1 Michael Catanzaro 2016-03-31 14:14:52 UTC
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
Comment 2 Günther Wutz 2016-04-01 07:05:39 UTC
Created attachment 325129 [details] [review]
Fixed Patch

Changed coding-style and replaced with constants
Comment 3 Michael Catanzaro 2016-04-01 15:53:20 UTC
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.
Comment 4 Günther Wutz 2016-04-01 18:28:23 UTC
Created attachment 325180 [details] [review]
Fixed Patch
Comment 5 Michael Catanzaro 2016-04-02 02:56:42 UTC
Thanks!