Merge lp:~azzar1/unity/fix-1413165 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3927
Proposed branch: lp:~azzar1/unity/fix-1413165
Merge into: lp:unity
Diff against target: 144 lines (+35/-5)
7 files modified
plugins/unityshell/src/unityshell.cpp (+14/-5)
tests/MockWindowManager.h (+1/-0)
unity-shared/StandaloneWindowManager.cpp (+5/-0)
unity-shared/StandaloneWindowManager.h (+1/-0)
unity-shared/WindowManager.h (+1/-0)
unity-shared/XWindowManager.cpp (+12/-0)
unity-shared/XWindowManager.h (+1/-0)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1413165
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+247150@code.launchpad.net

Commit message

Draw osk above unity shell.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2015-01-15 15:02:59 +0000
+++ plugins/unityshell/src/unityshell.cpp 2015-01-21 15:30:12 +0000
@@ -2978,10 +2978,14 @@
2978 }2978 }
2979 }2979 }
29802980
2981 if (uScreen->doShellRepaint &&2981 if (uScreen->doShellRepaint && window == uScreen->onboard_)
2982 window == uScreen->firstWindowAboveShell &&2982 {
2983 !uScreen->forcePaintOnTop() &&2983 uScreen->paintDisplay();
2984 !uScreen->fullscreenRegion.contains(window->geometry()))2984 }
2985 else if (uScreen->doShellRepaint &&
2986 window == uScreen->firstWindowAboveShell &&
2987 !uScreen->forcePaintOnTop() &&
2988 !uScreen->fullscreenRegion.contains(window->geometry()))
2985 {2989 {
2986 uScreen->paintDisplay();2990 uScreen->paintDisplay();
2987 }2991 }
@@ -3205,6 +3209,11 @@
3205 }));3209 }));
3206 }3210 }
3207 }3211 }
3212 else if (WindowManager::Default().IsOnscreenKeyboard(window->id()))
3213 {
3214 uScreen->onboard_ = window;
3215 uScreen->RaiseOSK();
3216 }
3208 /* Fall through an re-evaluate wraps on map and unmap too */3217 /* Fall through an re-evaluate wraps on map and unmap too */
3209 case CompWindowNotifyUnmap:3218 case CompWindowNotifyUnmap:
3210 if (uScreen->optionGetShowMinimizedWindows() && window->mapNum() &&3219 if (uScreen->optionGetShowMinimizedWindows() && window->mapNum() &&
@@ -4124,7 +4133,7 @@
4124 if (window->state() & CompWindowStateFullscreenMask)4133 if (window->state() & CompWindowStateFullscreenMask)
4125 uScreen->fullscreen_windows_.push_back(window);4134 uScreen->fullscreen_windows_.push_back(window);
41264135
4127 if (window->type() == CompWindowTypeUtilMask && window->resName() == "onboard")4136 if (WindowManager::Default().IsOnscreenKeyboard(window->id()) && window->isViewable())
4128 {4137 {
4129 uScreen->onboard_ = window;4138 uScreen->onboard_ = window;
4130 uScreen->RaiseOSK();4139 uScreen->RaiseOSK();
41314140
=== modified file 'tests/MockWindowManager.h'
--- tests/MockWindowManager.h 2013-08-08 14:43:50 +0000
+++ tests/MockWindowManager.h 2015-01-21 15:30:12 +0000
@@ -100,6 +100,7 @@
100 MOCK_METHOD0(RestoreInputFocus, bool());100 MOCK_METHOD0(RestoreInputFocus, bool());
101101
102 MOCK_CONST_METHOD1(GetWindowName, std::string(Window));102 MOCK_CONST_METHOD1(GetWindowName, std::string(Window));
103 MOCK_CONST_METHOD1(IsOnscreenKeyboard, bool(Window));
103104
104 MOCK_METHOD1(AddProperties, void(GVariantBuilder*));105 MOCK_METHOD1(AddProperties, void(GVariantBuilder*));
105};106};
106107
=== modified file 'unity-shared/StandaloneWindowManager.cpp'
--- unity-shared/StandaloneWindowManager.cpp 2014-07-30 00:49:35 +0000
+++ unity-shared/StandaloneWindowManager.cpp 2015-01-21 15:30:12 +0000
@@ -600,6 +600,11 @@
600 return "";600 return "";
601}601}
602602
603bool StandaloneWindowManager::IsOnscreenKeyboard(Window window_id) const
604{
605 return false;
606}
607
603std::string StandaloneWindowManager::GetStringProperty(Window, Atom) const608std::string StandaloneWindowManager::GetStringProperty(Window, Atom) const
604{609{
605 return std::string();610 return std::string();
606611
=== modified file 'unity-shared/StandaloneWindowManager.h'
--- unity-shared/StandaloneWindowManager.h 2014-10-10 14:56:53 +0000
+++ unity-shared/StandaloneWindowManager.h 2015-01-21 15:30:12 +0000
@@ -160,6 +160,7 @@
160 virtual bool RestoreInputFocus();160 virtual bool RestoreInputFocus();
161161
162 virtual std::string GetWindowName(Window window_id) const;162 virtual std::string GetWindowName(Window window_id) const;
163 virtual bool IsOnscreenKeyboard(Window window_id) const;
163 virtual std::string GetStringProperty(Window window_id, Atom) const;164 virtual std::string GetStringProperty(Window window_id, Atom) const;
164 virtual std::vector<long> GetCardinalProperty(Window window_id, Atom) const;165 virtual std::vector<long> GetCardinalProperty(Window window_id, Atom) const;
165166
166167
=== modified file 'unity-shared/WindowManager.h'
--- unity-shared/WindowManager.h 2014-10-10 14:56:53 +0000
+++ unity-shared/WindowManager.h 2015-01-21 15:30:12 +0000
@@ -165,6 +165,7 @@
165 virtual bool RestoreInputFocus() = 0;165 virtual bool RestoreInputFocus() = 0;
166166
167 virtual std::string GetWindowName(Window window_id) const = 0;167 virtual std::string GetWindowName(Window window_id) const = 0;
168 virtual bool IsOnscreenKeyboard(Window window_id) const = 0;
168169
169 virtual std::string GetStringProperty(Window, Atom) const = 0;170 virtual std::string GetStringProperty(Window, Atom) const = 0;
170 virtual std::vector<long> GetCardinalProperty(Window, Atom) const = 0;171 virtual std::vector<long> GetCardinalProperty(Window, Atom) const = 0;
171172
=== modified file 'unity-shared/XWindowManager.cpp'
--- unity-shared/XWindowManager.cpp 2014-10-01 02:30:09 +0000
+++ unity-shared/XWindowManager.cpp 2015-01-21 15:30:12 +0000
@@ -36,6 +36,7 @@
36{36{
37Atom _NET_WM_VISIBLE_NAME = 0;37Atom _NET_WM_VISIBLE_NAME = 0;
38Atom XA_COMPOUND_TEXT = 0;38Atom XA_COMPOUND_TEXT = 0;
39Atom ONSCREEN_KEYBOARD = 0;
39}40}
40}41}
4142
@@ -43,6 +44,7 @@
43{44{
44 atom::_NET_WM_VISIBLE_NAME = XInternAtom(screen->dpy(), "_NET_WM_VISIBLE_NAME", False);45 atom::_NET_WM_VISIBLE_NAME = XInternAtom(screen->dpy(), "_NET_WM_VISIBLE_NAME", False);
45 atom::XA_COMPOUND_TEXT = XInternAtom(screen->dpy(), "COMPOUND_TEXT", False);46 atom::XA_COMPOUND_TEXT = XInternAtom(screen->dpy(), "COMPOUND_TEXT", False);
47 atom::ONSCREEN_KEYBOARD = XInternAtom(screen->dpy(), "ONSCREEN_KEYBOARD", False);
46}48}
4749
48std::string XWindowManager::GetStringProperty(Window window_id, Atom atom) const50std::string XWindowManager::GetStringProperty(Window window_id, Atom atom) const
@@ -162,6 +164,16 @@
162 return GetStringProperty(window_id, XA_WM_NAME);164 return GetStringProperty(window_id, XA_WM_NAME);
163}165}
164166
167bool XWindowManager::IsOnscreenKeyboard(Window window_id) const
168{
169 std::vector<long> values = GetCardinalProperty(window_id, atom::ONSCREEN_KEYBOARD);
170
171 if (values.empty())
172 return false;
173
174 return values[0] != 0;
175}
176
165void XWindowManager::UnGrabMousePointer(Time timestamp, int button, int x, int y)177void XWindowManager::UnGrabMousePointer(Time timestamp, int button, int x, int y)
166{178{
167 Display* dpy = nux::GetGraphicsDisplay()->GetX11Display();179 Display* dpy = nux::GetGraphicsDisplay()->GetX11Display();
168180
=== modified file 'unity-shared/XWindowManager.h'
--- unity-shared/XWindowManager.h 2014-02-14 03:05:02 +0000
+++ unity-shared/XWindowManager.h 2015-01-21 15:30:12 +0000
@@ -34,6 +34,7 @@
34 void UnGrabMousePointer(Time, int button, int x, int y);34 void UnGrabMousePointer(Time, int button, int x, int y);
3535
36 std::string GetWindowName(Window window_id) const;36 std::string GetWindowName(Window window_id) const;
37 bool IsOnscreenKeyboard(Window window_id) const;
37 std::string GetStringProperty(Window window_id, Atom atom) const;38 std::string GetStringProperty(Window window_id, Atom atom) const;
38 std::vector<long> GetCardinalProperty(Window, Atom) const;39 std::vector<long> GetCardinalProperty(Window, Atom) const;
39};40};