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

Proposed by Santiago
Status: Merged
Approved by: Cody Garver
Approved revision: 715
Merged at revision: 716
Proposed branch: lp:~santileortiz/slingshot/fix-1635776
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 25 lines (+0/-12)
1 file modified
src/SlingshotView.vala (+0/-12)
To merge this branch: bzr merge lp:~santileortiz/slingshot/fix-1635776
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+314255@code.launchpad.net

Commit message

Remove ancient GDK_MODIFIER hack that breaks input methods like fcitx (lp:1602472)

Description of the change

Fixes input methods on the search entry.

All flags that were not modifiers were being cleared from the event, in particular GDK_MODIFIER_RESERVED_25_MASK was being cleared, which caused an infinite loop when an input method was active (for instance Fcitx).

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
=== modified file 'src/SlingshotView.vala'
--- src/SlingshotView.vala 2016-11-21 04:43:16 +0000
+++ src/SlingshotView.vala 2017-01-06 21:08:00 +0000
@@ -343,21 +343,9 @@
343 }343 }
344 }344 }
345345
346 /*
347 Overriding the default handler results in infinite loop of error messages
348 when an input method is in use (Gtk3 bug?). Key press events are
349 captured by an Event Box and passed to this function instead.
350
351 Events not dealt with here are propagated to the search_entry by the
352 usual mechanism.
353 */
354 public bool on_key_press (Gdk.EventKey event) {346 public bool on_key_press (Gdk.EventKey event) {
355 var key = Gdk.keyval_name (event.keyval).replace ("KP_", "");347 var key = Gdk.keyval_name (event.keyval).replace ("KP_", "");
356348
357 event.state &= (Gdk.ModifierType.SHIFT_MASK |
358 Gdk.ModifierType.MOD1_MASK |
359 Gdk.ModifierType.CONTROL_MASK);
360
361 if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0 &&349 if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0 &&
362 (key == "1" || key == "2")) {350 (key == "1" || key == "2")) {
363 change_view_mode (key);351 change_view_mode (key);

Subscribers

People subscribed via source and target branches