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

Proposed by Brandon Schaefer
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
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: mp+88450@code.launchpad.net

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/dash_tests.py for a hint as to how to write the test.

Cheers,

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 https://jenkins.qa.ubuntu.com/job/automerge-unity/260/console 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
=== modified file 'manual-tests/Dash.txt'
--- manual-tests/Dash.txt 2012-02-08 00:32:46 +0000
+++ manual-tests/Dash.txt 2012-02-13 10:17:18 +0000
@@ -67,3 +67,15 @@
67 The text previously selected is pasted on the search bar at mouse pointer67 The text previously selected is pasted on the search bar at mouse pointer
68 position, if the operation is repeated the text is inserted where68 position, if the operation is repeated the text is inserted where
69 the mouse pointer is.69 the mouse pointer is.
70
71Dash SearchBar IBus Focus
72------------------------------
73This test shows that the IBus is getting focus when it gets keyboard focus.
74
75#. Open the Dash
76#. Press Ctrl + Space to activate ibus
77#. Type "abc1"
78
79Outcome
80 Typing "abc1" while ibus is focused will produce 阿布从 . If the ibus is not focused
81 then "abc1" will be the outcome (This is incorrect behavior).
7082
=== modified file 'plugins/unityshell/src/IMTextEntry.cpp'
--- plugins/unityshell/src/IMTextEntry.cpp 2012-02-07 07:42:12 +0000
+++ plugins/unityshell/src/IMTextEntry.cpp 2012-02-13 10:17:18 +0000
@@ -46,6 +46,10 @@
46 CheckIMEnabled();46 CheckIMEnabled();
47 im_enabled ? SetupMultiIM() : SetupSimpleIM();47 im_enabled ? SetupMultiIM() : SetupSimpleIM();
4848
49 key_nav_focus_change.connect([&](nux::Area* area, bool focus, nux::KeyNavDirection dir)
50 {
51 focus ? OnFocusIn() : OnFocusOut();
52 });
49 mouse_up.connect(sigc::mem_fun(this, &IMTextEntry::OnMouseButtonUp));53 mouse_up.connect(sigc::mem_fun(this, &IMTextEntry::OnMouseButtonUp));
50}54}
5155
5256
=== modified file 'plugins/unityshell/src/IMTextEntry.h'
--- plugins/unityshell/src/IMTextEntry.h 2012-02-07 07:42:12 +0000
+++ plugins/unityshell/src/IMTextEntry.h 2012-02-13 10:17:18 +0000
@@ -66,6 +66,7 @@
6666
67 void OnFocusIn();67 void OnFocusIn();
68 void OnFocusOut();68 void OnFocusOut();
69
69 void UpdateCursorLocation();70 void UpdateCursorLocation();
7071
71 void OnMouseButtonUp(int x, int y, unsigned long bflags, unsigned long kflags);72 void OnMouseButtonUp(int x, int y, unsigned long bflags, unsigned long kflags);