Merge lp:~brandontschaefer/unity/fix-915828 into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Tim Penhey
Approved revision: 1834
Merged at revision: 1962
Proposed branch: lp:~brandontschaefer/unity/fix-915828
Merge into: lp:unity
Diff against target: 46 lines (+17/-0)
3 files modified
manual-tests/Dash.txt (+12/-0)
plugins/unityshell/src/IMTextEntry.cpp (+4/-0)
plugins/unityshell/src/IMTextEntry.h (+1/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/fix-915828
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Thomi Richards (community) Needs Fixing
Sam Spilsbury (community) Approve
Review via email:

Description of the change

Fixes the gtk-im-context not getting focused when the dash is opened. A signal from nux was removed causing this; couldn't find one to replace it. So using a property bool when the dash is about to show to call OnFocusIn(); when it is hiding OnFocusOut().

Not sure if I should have exposed those two functions in IMTextEntry.h, if that is not wanted I can add another property bool in IMTextEntry.cpp and use that focus in and out.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Is it possible to make DashView, DashSearchBar and IMEntry use named constructors ? In that case, you can create an DashView and DashSearchBar shared ptr and then pass that to the IMEntry constructor, then assign the IMEntry object to the DashSearchBar.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Any updates ?

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looking into a different signal to see if that can fix it. Also looking into a posisble nux fix. Else will look into using name constructors!

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Is this covered by tests already ?

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

As of right now there are no test cases, and Im not sure how to automate this so Ill push a manual test.

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

This should be an autopilot test, not a manual test. This will be super-easy to write in autopilot. See the other tests in tests/autopilot/autopilot/tests/ for a hint as to how to write the test.


review: Needs Fixing
Revision history for this message
Tim Penhey (thumper) wrote :

Test will be added after. ibus support is critical.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job reported an error when processing this lp:~brandontschaefer/unity/fix-915828 branch.
Not merging it.

Revision history for this message
Tim Penhey (thumper) wrote :

/home/tim/src/unity/hacking/plugins/unityshell/src/IMTextEntry.cpp: In constructor ‘unity::IMTextEntry::IMTextEntry()’:
/home/tim/src/unity/hacking/plugins/unityshell/src/IMTextEntry.cpp:49:3: error: ‘OnKeyNavFocusChange’ was not declared in this scope

Probably a trivial fix.

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Sorry looks like that just got changed in nux to key_nav_focus_change. Submitting a fix soon!

Revision history for this message
Tim Penhey (thumper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'manual-tests/Dash.txt'
2--- manual-tests/Dash.txt 2012-02-08 00:32:46 +0000
3+++ manual-tests/Dash.txt 2012-02-13 10:17:18 +0000
4@@ -67,3 +67,15 @@
5 The text previously selected is pasted on the search bar at mouse pointer
6 position, if the operation is repeated the text is inserted where
7 the mouse pointer is.
9+Dash SearchBar IBus Focus
11+This test shows that the IBus is getting focus when it gets keyboard focus.
13+#. Open the Dash
14+#. Press Ctrl + Space to activate ibus
15+#. Type "abc1"
18+ Typing "abc1" while ibus is focused will produce 阿布从 . If the ibus is not focused
19+ then "abc1" will be the outcome (This is incorrect behavior).
21=== modified file 'plugins/unityshell/src/IMTextEntry.cpp'
22--- plugins/unityshell/src/IMTextEntry.cpp 2012-02-07 07:42:12 +0000
23+++ plugins/unityshell/src/IMTextEntry.cpp 2012-02-13 10:17:18 +0000
24@@ -46,6 +46,10 @@
25 CheckIMEnabled();
26 im_enabled ? SetupMultiIM() : SetupSimpleIM();
28+ key_nav_focus_change.connect([&](nux::Area* area, bool focus, nux::KeyNavDirection dir)
29+ {
30+ focus ? OnFocusIn() : OnFocusOut();
31+ });
32 mouse_up.connect(sigc::mem_fun(this, &IMTextEntry::OnMouseButtonUp));
33 }
36=== modified file 'plugins/unityshell/src/IMTextEntry.h'
37--- plugins/unityshell/src/IMTextEntry.h 2012-02-07 07:42:12 +0000
38+++ plugins/unityshell/src/IMTextEntry.h 2012-02-13 10:17:18 +0000
39@@ -66,6 +66,7 @@
41 void OnFocusIn();
42 void OnFocusOut();
44 void UpdateCursorLocation();
46 void OnMouseButtonUp(int x, int y, unsigned long bflags, unsigned long kflags);