Merge lp:~jeremywootten/pantheon-files/fix-1675234-enter-while-searching-with-no-hits into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 2531
Merged at revision: 2534
Proposed branch: lp:~jeremywootten/pantheon-files/fix-1675234-enter-while-searching-with-no-hits
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 48 lines (+19/-1)
2 files modified
src/View/Widgets/BreadcrumbsEntry.vala (+9/-0)
src/View/Widgets/LocationBar.vala (+10/-1)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-1675234-enter-while-searching-with-no-hits
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+321902@code.launchpad.net

Commit message

Prevent the path bar emitting a path-change request if Enter is pressed before SearchResults has grabbed keyboard focus (which only occurs once the search window has popped up after at least one hit has been found).

This was causing a request for a non-existent folder to be emitted.

Description of the change

This branch prevents the path bar emitting a path-change request if Enter is pressed before SearchResults has grabbed keyboard focus (which only occurs once the search window has popped up after at least one hit has been found).

This was causing a request for a non-existent folder to be emitted.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/View/Widgets/BreadcrumbsEntry.vala'
2--- src/View/Widgets/BreadcrumbsEntry.vala 2017-02-10 19:35:18 +0000
3+++ src/View/Widgets/BreadcrumbsEntry.vala 2017-04-04 17:37:27 +0000
4@@ -33,6 +33,8 @@
5 * user enter /home/user/a, we will search for "a". */
6 string to_search = "";
7
8+ public bool search_mode = false; // Used to suppress activate events while searching
9+
10 /** Drag and drop support **/
11 public enum TargetType {
12 TEXT_URI_LIST,
13@@ -73,6 +75,13 @@
14 /************************************************/
15 public override bool on_key_press_event (Gdk.EventKey event) {
16 switch (event.keyval) {
17+ case Gdk.Key.Return:
18+ case Gdk.Key.KP_Enter:
19+ case Gdk.Key.ISO_Enter:
20+ if (search_mode) {
21+ return true;
22+ }
23+ break;
24 case Gdk.Key.KP_Tab:
25 case Gdk.Key.Tab:
26 complete ();
27
28=== modified file 'src/View/Widgets/LocationBar.vala'
29--- src/View/Widgets/LocationBar.vala 2017-02-10 19:35:18 +0000
30+++ src/View/Widgets/LocationBar.vala 2017-04-04 17:37:27 +0000
31@@ -25,7 +25,16 @@
32 private BreadcrumbsEntry bread;
33 private SearchResults search_results;
34 private GLib.File? search_location = null;
35- public bool search_mode {get; private set;}
36+
37+ public bool search_mode {
38+ get {
39+ return bread.search_mode;
40+ }
41+
42+ private set {
43+ bread.search_mode = value; //Ensure no path change requests from entry while searching
44+ }
45+ }
46
47 public new bool sensitive {
48 set {

Subscribers

People subscribed via source and target branches

to all changes: