Merge lp:~voldyman/slingshot/fixes-1261017 into lp:~elementary-pantheon/slingshot/trunk

Proposed by Akshay Shekher on 2014-05-24
Status: Merged
Approved by: Daniel Fore on 2014-05-24
Approved revision: 418
Merged at revision: 418
Proposed branch: lp:~voldyman/slingshot/fixes-1261017
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 28 lines (+11/-0)
1 file modified
src/SlingshotView.vala (+11/-0)
To merge this branch: bzr merge lp:~voldyman/slingshot/fixes-1261017
Reviewer Review Type Date Requested Status
Avi Romanoff 2014-05-24 Approve on 2014-05-24
Review via email: mp+220855@code.launchpad.net

Commit message

fix bug 1261017, Once the search bar gets focus, Super + Space does not close the window.

Description of the change

fix bug 1261017, Once the search bar gets focus, Super + Space does not close the window.

check the key press events for the search_entry, if super+space is detected, hide.

To post a comment you must log in.
Avi Romanoff (aroman) wrote :

Looks good, works for me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/SlingshotView.vala'
2--- src/SlingshotView.vala 2014-03-01 15:19:12 +0000
3+++ src/SlingshotView.vala 2014-05-24 10:27:51 +0000
4@@ -267,6 +267,8 @@
5 });
6
7 event_box.key_press_event.connect (on_key_press);
8+ search_entry.key_press_event.connect (search_entry_key_press);
9+
10 search_entry.search_changed.connect (() => this.search.begin (search_entry.text));
11 search_entry.grab_focus ();
12
13@@ -354,6 +356,15 @@
14 }
15 }
16
17+ // Handle super+space when the user is typing in the search entry
18+ private bool search_entry_key_press (Gdk.EventKey event) {
19+ if ((event.keyval == Gdk.Key.space) && ((event.state & Gdk.ModifierType.SUPER_MASK) != 0)) {
20+ hide ();
21+ return true;
22+ }
23+ return false;
24+ }
25+
26 /*
27 Overriding the default handler results in infinite loop of error messages
28 when an input method is in use (Gtk3 bug?). Key press events are

Subscribers

People subscribed via source and target branches