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
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2015-01-15 15:02:59 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2015-01-21 15:30:12 +0000
4@@ -2978,10 +2978,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@@ -3205,6 +3209,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@@ -4124,7 +4133,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-01-21 15:30:12 +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-07-30 00:49:35 +0000
59+++ unity-shared/StandaloneWindowManager.cpp 2015-01-21 15:30:12 +0000
60@@ -600,6 +600,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-10-10 14:56:53 +0000
75+++ unity-shared/StandaloneWindowManager.h 2015-01-21 15:30:12 +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-10-10 14:56:53 +0000
87+++ unity-shared/WindowManager.h 2015-01-21 15:30:12 +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-10-01 02:30:09 +0000
99+++ unity-shared/XWindowManager.cpp 2015-01-21 15:30:12 +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-01-21 15:30:12 +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 };