Merge lp:~quequotion/slingshot/fix-1635776 into lp:~elementary-pantheon/slingshot/trunk

Proposed by quequotion
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~quequotion/slingshot/fix-1635776
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 106 lines (+20/-12)
1 file modified
src/SlingshotView.vala (+20/-12)
To merge this branch: bzr merge lp:~quequotion/slingshot/fix-1635776
Reviewer Review Type Date Requested Status
Cody Garver (community) Disapprove
Santiago (community) Needs Fixing
Danielle Foré Needs Fixing
Kirill Romanov (community) test Needs Fixing
Review via email: mp+310705@code.launchpad.net

Commit message

gandalfn (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.

Description of the change

Update, rebased on upstream and gandalfn's branch:
Give event_box proper event masks, remove (redundant?) "search_entry.key_press_event.connect (on_key_press);", always "search_entry.key_press_event (event);" and "return true;" instead of "return false;"

Previously:
use "im_context_filter_keypress (event)" to enable input method editors to focus on slingshot; remove eventbox
//scrolling over the application icons probably requires the eventbox

To post a comment you must log in.
Revision history for this message
Santiago (santileortiz) :
review: Approve
Revision history for this message
Kirill Romanov (djaler1) wrote :

It broke scrolling for me.

review: Needs Fixing (test)
Revision history for this message
Danielle Foré (danrabbit) wrote :

I can confirm that this commit broke scrolling :(

review: Needs Fixing
Revision history for this message
Kirill Romanov (djaler1) wrote :

@danrabbit, so, can you revert this commit for now?

Revision history for this message
Santiago (santileortiz) :
review: Needs Fixing
Revision history for this message
Santiago (santileortiz) wrote :

The merge was reverted because it breaks scrolling with the mouse wheel for people even without IMs, I think events are being "eaten" by the search_entry widget because it has the focus. Previously even though this happened too, event_box was getting all of them too.

Anyway this is just speculation, I haven't tested all of this, but maybe adding EventBox back will fix it? (I have no idea what will happen to fcitx here).

Revision history for this message
quequotion (quequotion) wrote :

I do not have that problem now, buuuuuuut, I did until I patched all the gala and dbus I could find out of wingpanel:
https://github.com/quequotion/pantheon-bzr-qq/blob/master/wingpanel-standalone-bzr/minus-backgroundmanager.patch
https://github.com/quequotion/pantheon-bzr-qq/blob/master/wingpanel-standalone-bzr/minus-galaplugin.patch

I had that problem with vanilla wingpanel (bzr 154); but not after removing the background manager and gala plugins.

Note, when I say "scrolling is working for me with these patches" I mean that it works to scroll from page to page, but only when the mouse is over the category list or on either side of page numbers; my category list is not long enough to scroll, scroll always goes from page to page of application icons. Scrolling does not work when the mouse is over the icons. Is that normal?

This behavior is not affected (for me) with the "im_context_filter_keypress (event)" patch. In vanilla wingpanel scrolling is broken for me (and possibly other users running wingpanel without gala), in wingpanel-standalone scrolling works; in wingpanel with only the "im_context_filter_keypress (event)" patch scrolling still does not work (for me, and aparently everyone else).

Could someone, if just for the science of it, attempt to duplicate my results with wingpanel-standalone patches {and,or} the "im_context_filter_keypress (event)" patch? This could be a bug revealed, rather than caused, by my proposed merge.

Revision history for this message
quequotion (quequotion) wrote :

Do you need the EventBox (with gala)?

Revision history for this message
quequotion (quequotion) wrote :

I really didn't write this well; /omitted details/:

This behavior is not affected (for me) with the "im_context_filter_keypress (event)" patch /against slingshot/. In vanilla wingpanel scrolling /in vanilla slingshot/ is broken for me (and possibly other users running wingpanel/+slingshot/ without gala), in wingpanel-standalone scrolling /in vanilla slingshot/ works; in /vanilla/ wingpanel with only the "im_context_filter_keypress (event)" patch /against slingshot/ scrolling still does not work (for me, and aparently everyone else).

Revision history for this message
quequotion (quequotion) wrote :

> Do you need the EventBox (with gala)?
Tried with patch reduced to only:
@@ -562,7 +549,7 @@
                     if (!search_entry.has_focus) {
                         search_entry.grab_focus ();
                         search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
- search_entry.key_press_event (event);
+ search_entry.im_context_filter_keypress (event);
                     }
                     return false;

(restored EventBox code)

This did not help. Although scrolling (still) works, the EventBox causes two problems: each input character is doubled and slingshot does not refresh view while typing in the search box (or possibly process input at all) until changing desktops (ergo, likely on full screen redraw).

I really think the EventBox is problematic.

Revision history for this message
quequotion (quequotion) wrote :

With a little adjustment, gandalfn's branch works:
https://code.launchpad.net/~gandalfn/slingshot/fix-input-event/+merge/312215/comments/811190

Both gandalfn's patch and the debian patch additionally allow scrolling over application icons!

lp:~quequotion/slingshot/fix-1635776 updated
703. By quequotion

gandalfn's fix, slightly updated

704. By quequotion

Revert last

705. By quequotion

Rebase

706. By quequotion

gandalfn's patch retry

Revision history for this message
quequotion (quequotion) wrote :

Not sure how fcitx works without im_context_filter_keypress here, but it does so updated gandalfn's method, minus (stupendously minor) conflicts.

Revision history for this message
xhhqzxg24 (xhhqzxg24) wrote :

Thanks for your works, quequotion.
But I have to report a bug about this fixed.
I have two fcitx IM engines: fcitx-googlepinyin and fcitx-rime.
When I switch from rime to google (or from google to rime) on the searchbar,
everything has been stoped without keyboard.
Thanks again.

Revision history for this message
Santiago (santileortiz) wrote :

I just tested it, and it does fix scrolling and fcitx, but when I use Escape to quit Slingshot, if the search bar has focus, it won't close. I did the following to see what was going on:

=== modified file 'src/SlingshotView.vala'
--- src/SlingshotView.vala 2016-12-05 18:39:48 +0000
+++ src/SlingshotView.vala 2016-12-07 15:45:38 +0000
@@ -364,6 +364,7 @@
                 return true;
             }

+ print ("Key: %s\n", key);
             switch (key) {
                 case "F4":
                     if ((event.state & Gdk.ModifierType.MOD1_MASK) != 0) {

It seems that the when search_entry gains focus it grabs all events, and the only ones we receive in Slingshot are the ones it does not process, like EventScroll, or several modifiers like Alt_L (which is why Alt+F4 still works), but for some reason it's consuming Escape key presses, so it stops working.

Also, when pressing F1 while search_entry has focus, Slingshot enters an infinite loop and starts receiving a keypress event for F1 like crazy, maybe this is what the original comment was referring to?.

Revision history for this message
quequotion (quequotion) wrote :

> I have two fcitx IM engines: fcitx-googlepinyin and fcitx-rime.
> When I switch from rime to google (or from google to rime) on the searchbar,
> everything has been stoped without keyboard.
> Thanks again.

I have pinyin and anthy and this does not happen.
What key do you press to scroll input methods?

I have set CTRL+L_Shift to scroll input methods and CTRL+Spacebar to trigger input methods.

Revision history for this message
quequotion (quequotion) wrote :

> It seems that the when search_entry gains focus it grabs all events, and the
> only ones we receive in Slingshot are the ones it does not process, like
> EventScroll, or several modifiers like Alt_L (which is why Alt+F4 still
> works), but for some reason it's consuming Escape key presses, so it stops
> working.
Alt+F4 does not work for me--are you sure that's working through slingshot or by the window manager? Neither does Shift+Backspace. Tab and the other keys work, so long as there's no text in the search box. I can't see how this is caused by this patch, although it apparently is.

> Also, when pressing F1 while search_entry has focus, Slingshot enters an
> infinite loop and starts receiving a keypress event for F1 like crazy, maybe
> this is what the original comment was referring to?.
I don't think so. That comment regarded the case of overriding key_press_event to change key handling (which requires im_context_filter_keypress to avoid an infinite loop and enable input methods), rather than using an EventBox to intercept input. I think you have found a different infinite loop. What should F1 do?

Revision history for this message
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
Revision history for this message
Ezekiel Michael Angel (nolenumar) wrote :

Hey how can I unsubscribe from this emails? I get so many :(

On Jan 7, 2017 6:28 AM, "Cody Garver" <email address hidden> wrote:

> The proposal to merge lp:~quequotion/slingshot/fix-1635776 into
> lp:slingshot has been updated.
>
> Status: Needs review => Rejected
>
> For more details, see:
> https://code.launchpad.net/~quequotion/slingshot/fix-1635776/+merge/310705
> --
> You are subscribed to branch lp:slingshot.
>

Revision history for this message
quequotion (quequotion) wrote :

The removal of outdated, hacky code sounds like a good idea.

Santiago's version is working for me. fcitx works, scrolling works, and special keys also work.

Unmerged revisions

706. By quequotion

gandalfn's patch retry

705. By quequotion

Rebase

704. By quequotion

Revert last

703. By quequotion

gandalfn's fix, slightly updated

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/SlingshotView.vala'
--- src/SlingshotView.vala 2016-11-21 04:43:16 +0000
+++ src/SlingshotView.vala 2016-12-05 18:40:45 +0000
@@ -204,6 +204,7 @@
204 container.attach (stack, 0, 1, 1, 1);204 container.attach (stack, 0, 1, 1, 1);
205205
206 event_box = new Gtk.EventBox ();206 event_box = new Gtk.EventBox ();
207 event_box.add_events (Gdk.EventMask.SCROLL_MASK | Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK);
207 event_box.add (container);208 event_box.add (container);
208 // Add the container to the dialog's content area209 // Add the container to the dialog's content area
209210
@@ -233,7 +234,6 @@
233 });234 });
234235
235 event_box.key_press_event.connect (on_key_press);236 event_box.key_press_event.connect (on_key_press);
236 search_entry.key_press_event.connect (on_key_press);
237 // Showing a menu reverts the effect of the grab_device function.237 // Showing a menu reverts the effect of the grab_device function.
238 search_entry.search_changed.connect (() => {238 search_entry.search_changed.connect (() => {
239 if (modality != Modality.SEARCH_VIEW)239 if (modality != Modality.SEARCH_VIEW)
@@ -384,7 +384,8 @@
384 case "Enter": // "KP_Enter"384 case "Enter": // "KP_Enter"
385 case "Return":385 case "Return":
386 case "KP_Enter":386 case "KP_Enter":
387 return false;387 search_entry.key_press_event (event);
388 return true;
388389
389 case "Alt_L":390 case "Alt_L":
390 case "Alt_R":391 case "Alt_R":
@@ -402,8 +403,10 @@
402 case "9":403 case "9":
403 int page = int.parse (key);404 int page = int.parse (key);
404405
405 if (event.state != Gdk.ModifierType.MOD1_MASK)406 if (event.state != Gdk.ModifierType.MOD1_MASK) {
406 return false;407 search_entry.key_press_event (event);
408 return true;
409 }
407410
408 if (modality == Modality.NORMAL_VIEW) {411 if (modality == Modality.NORMAL_VIEW) {
409 if (page < 0 || page == 9)412 if (page < 0 || page == 9)
@@ -416,7 +419,8 @@
416 else419 else
417 category_view.app_view.go_to_number (page);420 category_view.app_view.go_to_number (page);
418 } else {421 } else {
419 return false;422 search_entry.key_press_event (event);
423 return true;
420 }424 }
421 search_entry.grab_focus ();425 search_entry.grab_focus ();
422 break;426 break;
@@ -515,17 +519,19 @@
515 if (event.state == Gdk.ModifierType.SHIFT_MASK) { // Shift + Delete519 if (event.state == Gdk.ModifierType.SHIFT_MASK) { // Shift + Delete
516 search_entry.text = "";520 search_entry.text = "";
517 } else if (search_entry.has_focus) {521 } else if (search_entry.has_focus) {
518 return false;522 search_entry.key_press_event (event);
523 return true;
519 } else {524 } else {
520 search_entry.grab_focus ();525 search_entry.grab_focus ();
521 search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);526 search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
522 return false;527 return true;
523 }528 }
524 break;529 break;
525530
526 case "Home":531 case "Home":
527 if (search_entry.text.length > 0) {532 if (search_entry.text.length > 0) {
528 return false;533 search_entry.key_press_event (event);
534 return true;
529 }535 }
530536
531 if (modality == Modality.NORMAL_VIEW) {537 if (modality == Modality.NORMAL_VIEW) {
@@ -538,7 +544,8 @@
538544
539 case "End":545 case "End":
540 if (search_entry.text.length > 0) {546 if (search_entry.text.length > 0) {
541 return false;547 search_entry.key_press_event (event);
548 return true;
542 }549 }
543550
544 if (modality == Modality.NORMAL_VIEW) {551 if (modality == Modality.NORMAL_VIEW) {
@@ -554,7 +561,8 @@
554 if ((event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK)) != 0) {561 if ((event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK)) != 0) {
555 search_entry.paste_clipboard ();562 search_entry.paste_clipboard ();
556 } else {563 } else {
557 return false;564 search_entry.key_press_event (event);
565 return true;
558 }566 }
559 break;567 break;
560568
@@ -562,9 +570,9 @@
562 if (!search_entry.has_focus) {570 if (!search_entry.has_focus) {
563 search_entry.grab_focus ();571 search_entry.grab_focus ();
564 search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);572 search_entry.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
565 search_entry.key_press_event (event);
566 }573 }
567 return false;574 search_entry.key_press_event (event);
575 return true;
568576
569 }577 }
570578

Subscribers

People subscribed via source and target branches