Merge lp:~brandontschaefer/unity/dash-osk-fix into lp:unity/6.0

Proposed by Brandon Schaefer
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: no longer in the source branch.
Merged at revision: 2769
Proposed branch: lp:~brandontschaefer/unity/dash-osk-fix
Merge into: lp:unity/6.0
Diff against target: 116 lines (+60/-6)
4 files modified
manual-tests/Dash.txt (+19/-0)
plugins/unityshell/src/unityshell.cpp (+14/-6)
unity-shared/PluginAdapter.h (+2/-0)
unity-shared/PluginAdapterCompiz.cpp (+25/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/dash-osk-fix
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+128290@code.launchpad.net

Commit message

On screen keyboard now work with the Dash, when it is outside the Dashs' geo.

Description of the change

=== Problem ===
When you click outside of the dashs geo it will close. If you have have an OSK and click on it, where it is outside of the dashs geo it will close the dash. (This makes OSK uses vs the dash).

=== Fix ===
Take the overlay and check if any windows are above it that are AlwaysOnTop. If there is one then check if the mouse in its geo. If the mouse click is in its geo then do not close th dash.

=== Test ===
Manual test

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Tested, fixes the problem for me. Could we maybe do an AP test from this one in any way? Since the test steps seem automate-able. But for now, I think it's cool.

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-09-13 10:56:42 +0000
3+++ manual-tests/Dash.txt 2012-10-05 17:03:21 +0000
4@@ -113,6 +113,25 @@
5 The screen should look the same as if you had never opened the dash.
6
7
8+Test that when an on screen keyboard is used it will not close the Dash.
9+------------------------------------------------------------------------
10+This tests shows that an on screen keyboards will not close the dash when clicking on it.
11+see lp:1058705)
12+
13+Setup:
14+Open the on screen keyboard Onboard.
15+#. Move Onboard to the bottom right of the screen.
16+#. Open the Dash
17+#. Ensure the Dash is not in fullscreen mode.
18+#. Ensure that Onboard is outside of the Dash.
19+
20+Actions:
21+#. Use Onboard to type "Hello" in the Dash.
22+
23+Expected Results:
24+ The Dash should stay open, and allow use of the on screen keyboard.
25+
26+
27 Filter Results Tests
28 ========================
29 These tests show that the dash "All" button works well.
30
31=== modified file 'plugins/unityshell/src/unityshell.cpp'
32--- plugins/unityshell/src/unityshell.cpp 2012-10-04 14:08:31 +0000
33+++ plugins/unityshell/src/unityshell.cpp 2012-10-05 17:03:21 +0000
34@@ -1503,9 +1503,13 @@
35 if (dash_controller_->IsVisible())
36 {
37 nux::Point pt(event->xbutton.x_root, event->xbutton.y_root);
38- nux::Geometry dash_geo = dash_controller_->GetInputWindowGeometry();
39-
40- if (!dash_geo.IsInside(pt) && !DoesPointIntersectUnityGeos(pt))
41+ nux::Geometry const& dash_geo = dash_controller_->GetInputWindowGeometry();
42+
43+ Window dash_xid = dash_controller_->window()->GetInputWindowId();
44+ Window top_xid = wm->GetTopWindowAbove(dash_xid);
45+ nux::Geometry const& on_top_geo = wm->GetWindowGeometry(top_xid);
46+
47+ if (!dash_geo.IsInside(pt) && !DoesPointIntersectUnityGeos(pt) && !on_top_geo.IsInside(pt))
48 {
49 dash_controller_->HideDash(false);
50 }
51@@ -1514,9 +1518,13 @@
52 if (hud_controller_->IsVisible())
53 {
54 nux::Point pt(event->xbutton.x_root, event->xbutton.y_root);
55- nux::Geometry hud_geo = hud_controller_->GetInputWindowGeometry();
56-
57- if (!hud_geo.IsInside(pt) && !DoesPointIntersectUnityGeos(pt))
58+ nux::Geometry const& hud_geo = hud_controller_->GetInputWindowGeometry();
59+
60+ Window hud_xid = dash_controller_->window()->GetInputWindowId();
61+ Window top_xid = wm->GetTopWindowAbove(hud_xid);
62+ nux::Geometry const& on_top_geo = wm->GetWindowGeometry(top_xid);
63+
64+ if (!hud_geo.IsInside(pt) && !DoesPointIntersectUnityGeos(pt) && !on_top_geo.IsInside(pt))
65 {
66 hud_controller_->HideHud(false);
67 }
68
69=== modified file 'unity-shared/PluginAdapter.h'
70--- unity-shared/PluginAdapter.h 2012-10-01 19:12:00 +0000
71+++ unity-shared/PluginAdapter.h 2012-10-05 17:03:21 +0000
72@@ -173,6 +173,8 @@
73
74 void MoveResizeWindow(guint32 xid, nux::Geometry geometry);
75
76+ Window GetTopWindowAbove(Window xid) const;
77+
78 protected:
79 PluginAdapter(CompScreen* screen);
80 void AddProperties(GVariantBuilder* builder);
81
82=== modified file 'unity-shared/PluginAdapterCompiz.cpp'
83--- unity-shared/PluginAdapterCompiz.cpp 2012-10-01 19:12:00 +0000
84+++ unity-shared/PluginAdapterCompiz.cpp 2012-10-05 17:03:21 +0000
85@@ -594,6 +594,31 @@
86 return 0;
87 }
88
89+Window PluginAdapter::GetTopWindowAbove(Window xid) const
90+{
91+ CompWindow* window;
92+ CompPoint screen_vp = m_Screen->vp();
93+
94+ auto const& windows = m_Screen->windows();
95+ for (auto it = windows.rbegin(); it != windows.rend(); ++it)
96+ {
97+ window = *it;
98+ if (window->defaultViewport() == screen_vp &&
99+ window->isViewable() && window->isMapped() &&
100+ !window->minimized() && !window->inShowDesktopMode() &&
101+ !(window->type() & CompWindowTypeSplashMask) &&
102+ !(window->type() & CompWindowTypeDockMask))
103+ {
104+ return window->id();
105+ }
106+ else if (window->id() == xid)
107+ {
108+ return 0;
109+ }
110+ }
111+ return 0;
112+}
113+
114 bool
115 PluginAdapter::IsWindowClosable(guint32 xid) const
116 {

Subscribers

People subscribed via source and target branches