diff options
author | Christian Dywan <christian@twotoasts.de> | 2019-02-27 19:06:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 19:06:18 +0100 |
commit | 525f76c68fdde8a2d974c6975d9cc5ebe0cd594b (patch) | |
tree | 24f484ef5cb3d548e58a2927dbbc3906f5f96f86 | |
parent | 497000a26aed2c56a79478bf1bcb851f5e9b6e03 (diff) | |
download | midori-git-525f76c68fdde8a2d974c6975d9cc5ebe0cd594b.tar.gz |
Don't override Del if row can't be deleted (#278)
Handling of the Delete key with the suggestions popover visible
needs to fallback to the key press event (of the entry) if the
selected row can't be deleted.
The item should also be checked to be backed by a database.
Fixes: #269
-rw-r--r-- | core/urlbar.vala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/urlbar.vala b/core/urlbar.vala index 4e279e24..2d217861 100644 --- a/core/urlbar.vala +++ b/core/urlbar.vala @@ -106,11 +106,12 @@ namespace Midori { case Gdk.Key.Delete: case Gdk.Key.KP_Delete: var suggestion_row = (SuggestionRow)selected_row; - if (suggestion_row != null && !suggestion_row.item.database.readonly) { + if (suggestion_row != null && suggestion_row.item.database != null && !suggestion_row.item.database.readonly) { listbox.move_cursor (Gtk.MovementStep.DISPLAY_LINES, -1); suggestion_row.item.delete.begin (); + return true; } - return true; + return base.key_press_event (event); case Gdk.Key.Escape: popdown (); return true; |