Merge lp:~townsend/unity/fix-lp1413165-trusty into lp:unity/7.2

Proposed by Christopher Townsend
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3822
Proposed branch: lp:~townsend/unity/fix-lp1413165-trusty
Merge into: lp:unity/7.2
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:~townsend/unity/fix-lp1413165-trusty
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Stephen M. Webb (community) Approve
Review via email: mp+259284@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
Stephen M. Webb (bregma) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2015-03-16 17:30:24 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2015-05-15 19:50:26 +0000
4@@ -2976,10 +2976,14 @@
5 }
6 }
7
8- if (uScreen->doShellRepaint &&
9- window == uScreen->firstWindowAboveShell &&
10- !uScreen->forcePaintOnTop() &&
11- !uScreen->fullscreenRegion.contains(window->geometry()))
12+ if (uScreen->doShellRepaint && window == uScreen->onboard_)
13+ {
14+ uScreen->paintDisplay();
15+ }
16+ else if (uScreen->doShellRepaint &&
17+ window == uScreen->firstWindowAboveShell &&
18+ !uScreen->forcePaintOnTop() &&
19+ !uScreen->fullscreenRegion.contains(window->geometry()))
20 {
21 uScreen->paintDisplay();
22 }
23@@ -3203,6 +3207,11 @@
24 }));
25 }
26 }
27+ else if (WindowManager::Default().IsOnscreenKeyboard(window->id()))
28+ {
29+ uScreen->onboard_ = window;
30+ uScreen->RaiseOSK();
31+ }
32 /* Fall through an re-evaluate wraps on map and unmap too */
33 case CompWindowNotifyUnmap:
34 if (uScreen->optionGetShowMinimizedWindows() && window->mapNum() &&
35@@ -4122,7 +4131,7 @@
36 if (window->state() & CompWindowStateFullscreenMask)
37 uScreen->fullscreen_windows_.push_back(window);
38
39- if (window->type() == CompWindowTypeUtilMask && window->resName() == "onboard")
40+ if (WindowManager::Default().IsOnscreenKeyboard(window->id()) && window->isViewable())
41 {
42 uScreen->onboard_ = window;
43 uScreen->RaiseOSK();
44
45=== modified file 'tests/MockWindowManager.h'
46--- tests/MockWindowManager.h 2013-08-08 14:43:50 +0000
47+++ tests/MockWindowManager.h 2015-05-15 19:50:26 +0000
48@@ -100,6 +100,7 @@
49 MOCK_METHOD0(RestoreInputFocus, bool());
50
51 MOCK_CONST_METHOD1(GetWindowName, std::string(Window));
52+ MOCK_CONST_METHOD1(IsOnscreenKeyboard, bool(Window));
53
54 MOCK_METHOD1(AddProperties, void(GVariantBuilder*));
55 };
56
57=== modified file 'unity-shared/StandaloneWindowManager.cpp'
58--- unity-shared/StandaloneWindowManager.cpp 2014-04-02 21:42:12 +0000
59+++ unity-shared/StandaloneWindowManager.cpp 2015-05-15 19:50:26 +0000
60@@ -603,6 +603,11 @@
61 return "";
62 }
63
64+bool StandaloneWindowManager::IsOnscreenKeyboard(Window window_id) const
65+{
66+ return false;
67+}
68+
69 std::string StandaloneWindowManager::GetStringProperty(Window, Atom) const
70 {
71 return std::string();
72
73=== modified file 'unity-shared/StandaloneWindowManager.h'
74--- unity-shared/StandaloneWindowManager.h 2014-12-16 19:27:36 +0000
75+++ unity-shared/StandaloneWindowManager.h 2015-05-15 19:50:26 +0000
76@@ -160,6 +160,7 @@
77 virtual bool RestoreInputFocus();
78
79 virtual std::string GetWindowName(Window window_id) const;
80+ virtual bool IsOnscreenKeyboard(Window window_id) const;
81 virtual std::string GetStringProperty(Window window_id, Atom) const;
82 virtual std::vector<long> GetCardinalProperty(Window window_id, Atom) const;
83
84
85=== modified file 'unity-shared/WindowManager.h'
86--- unity-shared/WindowManager.h 2014-12-16 19:27:36 +0000
87+++ unity-shared/WindowManager.h 2015-05-15 19:50:26 +0000
88@@ -165,6 +165,7 @@
89 virtual bool RestoreInputFocus() = 0;
90
91 virtual std::string GetWindowName(Window window_id) const = 0;
92+ virtual bool IsOnscreenKeyboard(Window window_id) const = 0;
93
94 virtual std::string GetStringProperty(Window, Atom) const = 0;
95 virtual std::vector<long> GetCardinalProperty(Window, Atom) const = 0;
96
97=== modified file 'unity-shared/XWindowManager.cpp'
98--- unity-shared/XWindowManager.cpp 2014-12-08 22:38:02 +0000
99+++ unity-shared/XWindowManager.cpp 2015-05-15 19:50:26 +0000
100@@ -36,6 +36,7 @@
101 {
102 Atom _NET_WM_VISIBLE_NAME = 0;
103 Atom XA_COMPOUND_TEXT = 0;
104+Atom ONSCREEN_KEYBOARD = 0;
105 }
106 }
107
108@@ -43,6 +44,7 @@
109 {
110 atom::_NET_WM_VISIBLE_NAME = XInternAtom(screen->dpy(), "_NET_WM_VISIBLE_NAME", False);
111 atom::XA_COMPOUND_TEXT = XInternAtom(screen->dpy(), "COMPOUND_TEXT", False);
112+ atom::ONSCREEN_KEYBOARD = XInternAtom(screen->dpy(), "ONSCREEN_KEYBOARD", False);
113 }
114
115 std::string XWindowManager::GetStringProperty(Window window_id, Atom atom) const
116@@ -162,6 +164,16 @@
117 return GetStringProperty(window_id, XA_WM_NAME);
118 }
119
120+bool XWindowManager::IsOnscreenKeyboard(Window window_id) const
121+{
122+ std::vector<long> values = GetCardinalProperty(window_id, atom::ONSCREEN_KEYBOARD);
123+
124+ if (values.empty())
125+ return false;
126+
127+ return values[0] != 0;
128+}
129+
130 void XWindowManager::UnGrabMousePointer(Time timestamp, int button, int x, int y)
131 {
132 Display* dpy = nux::GetGraphicsDisplay()->GetX11Display();
133
134=== modified file 'unity-shared/XWindowManager.h'
135--- unity-shared/XWindowManager.h 2014-02-14 03:05:02 +0000
136+++ unity-shared/XWindowManager.h 2015-05-15 19:50:26 +0000
137@@ -34,6 +34,7 @@
138 void UnGrabMousePointer(Time, int button, int x, int y);
139
140 std::string GetWindowName(Window window_id) const;
141+ bool IsOnscreenKeyboard(Window window_id) const;
142 std::string GetStringProperty(Window window_id, Atom atom) const;
143 std::vector<long> GetCardinalProperty(Window, Atom) const;
144 };

Subscribers

People subscribed via source and target branches

to status/vote changes: