Merge lp:~gandalfn/slingshot/fix-input-event into lp:~elementary-pantheon/slingshot/trunk

Proposed by Zisu Andrei on 2016-12-01
Status: Rejected
Rejected by: Cody Garver on 2017-01-07
Proposed branch: lp:~gandalfn/slingshot/fix-input-event
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 111 lines (+24/-11) (has conflicts)
1 file modified
src/SlingshotView.vala (+24/-11)
Text conflict in src/SlingshotView.vala
To merge this branch: bzr merge lp:~gandalfn/slingshot/fix-input-event
Reviewer Review Type Date Requested Status
Cody Garver Disapprove on 2017-01-07
Adam Bieńkowski code 2016-12-01 Needs Fixing on 2016-12-05
Review via email: mp+312215@code.launchpad.net
To post a comment you must log in.
quequotion (quequotion) wrote :

Are these supposed to be here?

<<<<<<< TREE
=======
>>>>>>> MERGE-SOURCE

Adam Bieńkowski (donadigo) wrote :

Conflicts with trunk.

review: Needs Fixing (code)
quequotion (quequotion) wrote :

> Are these supposed to be here?
>
> <<<<<<< TREE
> =======
> >>>>>>> MERGE-SOURCE

After fixing that part of the patch, gandalfn's merge proposal works.

This patch is very similar to the pantheon-debian patch:
https://gitlab.com/pantheon-debian/slingshot-launcher/commit/db8474f079a02ad005d662040ff6452c1e2f0b05

Except for this section:
@@ -402,8 +408,10 @@
                 case "9":
                     int page = int.parse (key);

- if (event.state != Gdk.ModifierType.MOD1_MASK)
- return false;
+ if (event.state != Gdk.ModifierType.MOD1_MASK) {
+ search_entry.key_press_event (event);
+ return true;
+ }

                     if (modality == Modality.NORMAL_VIEW) {
                         if (page < 0 || page == 9)

Is either preferrable for any reason?

Zisu Andrei (matzipan) wrote :

This seems to be an inactive branch. Perhaps we should create a new merge request based on this.

quequotion (quequotion) wrote :

>>matzipan
I've updated my branch, rebased upstream, and reimplemented gandalfn's method:
https://code.launchpad.net/~quequotion/slingshot/fix-1635776/+merge/310705

Cody Garver (codygarver) wrote :

I am rejecting this branch because we are accepting the simpler proposal (https://code.launchpad.net/~santileortiz/slingshot/fix-1635776/+merge/314255), which removes old hacky code that appears to be the source of the problem.

However, we've already reverted 1 commit that intended to fix this problem, so please stick around to make sure the problem is finally solved.

review: Disapprove

Unmerged revisions

651. By gandalfn on 2016-05-06

The scroll and key press/release event forwading from event box does not
work on debian testing.
Activate the default event mask for this events for event box.
Disconnect search entry key press/release event from event forwarding.
Send key press/release event forwarding from event box to search entry in all case.

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 2016-11-21 04:43:16 +0000
3+++ src/SlingshotView.vala 2016-12-01 00:54:11 +0000
4@@ -204,6 +204,7 @@
5 container.attach (stack, 0, 1, 1, 1);
6
7 event_box = new Gtk.EventBox ();
8+ event_box.add_events (Gdk.EventMask.SCROLL_MASK | Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK);
9 event_box.add (container);
10 // Add the container to the dialog's content area
11
12@@ -233,7 +234,6 @@
13 });
14
15 event_box.key_press_event.connect (on_key_press);
16- search_entry.key_press_event.connect (on_key_press);
17 // Showing a menu reverts the effect of the grab_device function.
18 search_entry.search_changed.connect (() => {
19 if (modality != Modality.SEARCH_VIEW)
20@@ -384,8 +384,14 @@
21 case "Enter": // "KP_Enter"
22 case "Return":
23 case "KP_Enter":
24+<<<<<<< TREE
25 return false;
26
27+=======
28+ search_entry.key_press_event (event);
29+ return true;
30+
31+>>>>>>> MERGE-SOURCE
32 case "Alt_L":
33 case "Alt_R":
34 break;
35@@ -402,8 +408,10 @@
36 case "9":
37 int page = int.parse (key);
38
39- if (event.state != Gdk.ModifierType.MOD1_MASK)
40- return false;
41+ if (event.state != Gdk.ModifierType.MOD1_MASK) {
42+ search_entry.key_press_event (event);
43+ return true;
44+ }
45
46 if (modality == Modality.NORMAL_VIEW) {
47 if (page < 0 || page == 9)
48@@ -416,7 +424,8 @@
49 else
50 category_view.app_view.go_to_number (page);
51 } else {
52- return false;
53+ search_entry.key_press_event (event);
54+ return true;
55 }
56 search_entry.grab_focus ();
57 break;
58@@ -515,17 +524,19 @@
59 if (event.state == Gdk.ModifierType.SHIFT_MASK) { // Shift + Delete
60 search_entry.text = "";
61 } else if (search_entry.has_focus) {
62- return false;
63+ search_entry.key_press_event (event);
64+ return true;
65 } else {
66 search_entry.grab_focus ();
67 search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
68- return false;
69+ return true;
70 }
71 break;
72
73 case "Home":
74 if (search_entry.text.length > 0) {
75- return false;
76+ search_entry.key_press_event (event);
77+ return true;
78 }
79
80 if (modality == Modality.NORMAL_VIEW) {
81@@ -538,7 +549,8 @@
82
83 case "End":
84 if (search_entry.text.length > 0) {
85- return false;
86+ search_entry.key_press_event (event);
87+ return true;
88 }
89
90 if (modality == Modality.NORMAL_VIEW) {
91@@ -554,7 +566,8 @@
92 if ((event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK)) != 0) {
93 search_entry.paste_clipboard ();
94 } else {
95- return false;
96+ search_entry.key_press_event (event);
97+ return true;
98 }
99 break;
100
101@@ -562,9 +575,9 @@
102 if (!search_entry.has_focus) {
103 search_entry.grab_focus ();
104 search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
105- search_entry.key_press_event (event);
106 }
107- return false;
108+ search_entry.key_press_event (event);
109+ return true;
110
111 }
112

Subscribers

People subscribed via source and target branches