Merge lp:~mir-team/platform-api/support-state-changing into lp:platform-api

Proposed by Robert Carr
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 276
Merged at revision: 273
Proposed branch: lp:~mir-team/platform-api/support-state-changing
Merge into: lp:platform-api
Diff against target: 244 lines (+67/-7)
15 files modified
CMakeLists.txt (+1/-1)
android/default/default_ubuntu_application_ui.cpp (+9/-0)
debian/changelog (+6/-0)
debian/libubuntu-application-api2.symbols (+1/-0)
include/ubuntu/application/ui/window.h (+6/-0)
src/ubuntu/application/base_module.h (+1/-1)
src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp (+6/-0)
src/ubuntu/application/common/mirclient/window_mirclient.cpp (+26/-1)
src/ubuntu/application/common/mirclient/window_mirclient_priv.h (+2/-1)
src/ubuntu/application/desktop/module_version.h (+1/-1)
src/ubuntu/application/testbackend/module_version.h (+1/-1)
src/ubuntu/application/testbackend/test_stubs.cpp (+4/-0)
src/ubuntu/application/touch/hybris/ubuntu_application_api_hybris.cpp (+1/-0)
src/ubuntu/application/touch/module_version.h (+1/-1)
src/ubuntu/application/ubuntu_application_api.cpp (+1/-0)
To merge this branch: bzr merge lp:~mir-team/platform-api/support-state-changing
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Daniel d'Andrada (community) Approve
Gerry Boland (community) Approve
Review via email: mp+235545@code.launchpad.net

Commit message

Support requesting the restored state as a way to leave fullscreen.

Description of the change

Support requesting the restored state as a way to leave fullscreen.

Part of the solution for:
https://bugs.launchpad.net/ubuntu/+source/webbrowser-app/+bug/1328839

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Need to bump the debian package version number.
Doesn't libubuntu-application-api2.symbols need to have the new symbol added (I expected CI to complain about that)?

Looks ok otherwise.

android/default/default_ubuntu_application_ui.cpp - I don't think this code ever used any more, but maybe a mock implementation needed here? ricmm would know better

review: Needs Fixing
Revision history for this message
Ricardo Mendoza (ricmm) wrote :

Hey, as you are adding a new function please bump the minor version. To do this, take a look at https://code.launchpad.net/~thomas-voss/platform-api/correct-errors-from-qtposition-plugin/+merge/234742 for an example of how tvoss did it. Make sure to bump the relevant headers that help the main library find the relevant modules.

About defaults/ android. The UI bits are unused, however they remain the only foundation we have to do system bring up with SF in case of things getting complicated with Mir. I expect this to get a revision in the future to better enable this use case, so it is not yet marked from dropping.

Revision history for this message
Robert Carr (robertcarr) wrote :

Gave a try at bumping the version

Revision history for this message
Robert Carr (robertcarr) wrote :

Pushed a stub android impl so things will at least link but it doesnt seem worth trying to implement at the moment.

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: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM

Revision history for this message
Gerry Boland (gerboland) :
review: Approve
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

It's adding duplicate entries to debian/changelog.

---------------

Gotta update debian/libubuntu-application-api2.symbols. Instead of specifying a version put the placeholder "0replaceme" instead. CI will take care of replacing it with the version number being released.

----------------

in CMakeLists.txt:

"""
-set(UBUNTU_PLATFORM_API_VERSION_MINOR 3)
+set(UBUNTU_PLATFORM_API_VERSION_MINOR 5)
"""

Why jumping from 3 to 5 (skipping 4)?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

Updated symbols file.

Jump from 3-5 is because it seems Gerry previously released 2.4.0 (see debian/changelog) but did not updated the cmake list.

274. By Robert Carr

Update symbols file

275. By Robert Carr

Fix typo in doc comment

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
276. By Robert Carr

Revert duplicate changelog entry

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Looks good.

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 'CMakeLists.txt'
2--- CMakeLists.txt 2014-09-16 18:23:27 +0000
3+++ CMakeLists.txt 2014-10-01 00:44:13 +0000
4@@ -3,7 +3,7 @@
5 project(ubuntu-platform-api)
6
7 set(UBUNTU_PLATFORM_API_VERSION_MAJOR 2)
8-set(UBUNTU_PLATFORM_API_VERSION_MINOR 3)
9+set(UBUNTU_PLATFORM_API_VERSION_MINOR 5)
10 set(UBUNTU_PLATFORM_API_VERSION_PATCH 0)
11
12 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
13
14=== modified file 'android/default/default_ubuntu_application_ui.cpp'
15--- android/default/default_ubuntu_application_ui.cpp 2014-09-26 14:43:12 +0000
16+++ android/default/default_ubuntu_application_ui.cpp 2014-10-01 00:44:13 +0000
17@@ -435,6 +435,15 @@
18 session->toggle_fullscreen_for_surface(p->value);
19 }
20
21+void
22+ua_ui_window_request_state(
23+ UAUiWindow *window, UApplicationUiWindowState state)
24+{
25+ ALOGI("ua_ui_window_request_state unimplemented %s:%d", __PRETTY_FUNCTION__, __LINE__);
26+ (void) window;
27+ (void) state;
28+}
29+
30 EGLNativeWindowType
31 ua_ui_window_get_native_type(
32 UAUiWindow *window)
33
34=== modified file 'debian/changelog'
35--- debian/changelog 2014-09-29 15:05:47 +0000
36+++ debian/changelog 2014-10-01 00:44:13 +0000
37@@ -1,3 +1,9 @@
38+platform-api (2.5.0+14.10.20140929-0ubuntu1) UNRELEASED; urgency=medium
39+
40+ * Bump minor version due to new symbols (ua_ui_window_request_state).
41+
42+ -- Robert Carr <robert.carr@canonical.com> Mon, 29 Sep 2014 13:56:21 -0700
43+
44 platform-api (2.4.0+14.10.20140929-0ubuntu1) utopic; urgency=low
45
46 [ Gerry Boland ]
47
48=== modified file 'debian/libubuntu-application-api2.symbols'
49--- debian/libubuntu-application-api2.symbols 2014-09-22 17:51:27 +0000
50+++ debian/libubuntu-application-api2.symbols 2014-10-01 00:44:13 +0000
51@@ -132,6 +132,7 @@
52 ua_ui_window_properties_set_role@Base 0.18.1daily13.06.21
53 ua_ui_window_properties_set_titlen@Base 0.18.1daily13.06.21
54 ua_ui_window_request_fullscreen@Base 0.18.1daily13.06.21
55+ ua_ui_window_request_state@Base 0replaceme
56 ua_ui_window_resize@Base 0.18.1daily13.06.21
57 ua_ui_window_show@Base 0.18.1daily13.06.21
58 ua_url_dispatcher_session@Base 0.18.3+13.10.20130823-0ubuntu1
59
60=== modified file 'include/ubuntu/application/ui/window.h'
61--- include/ubuntu/application/ui/window.h 2014-08-20 17:13:47 +0000
62+++ include/ubuntu/application/ui/window.h 2014-10-01 00:44:13 +0000
63@@ -25,6 +25,7 @@
64 #include <ubuntu/status.h>
65 #include <ubuntu/application/instance.h>
66 #include <ubuntu/application/ui/window_properties.h>
67+#include <ubuntu/application/ui/window_state.h>
68 #include <ubuntu/application/ui/window_orientation.h>
69
70 #include <EGL/egl.h>
71@@ -78,6 +79,7 @@
72 ua_ui_window_show(
73 UAUiWindow *window);
74
75+ // Deprecated. Prefer ua_ui_window_request_state.
76 UBUNTU_DLL_PUBLIC void
77 ua_ui_window_request_fullscreen(
78 UAUiWindow *window);
79@@ -89,6 +91,10 @@
80 UBUNTU_DLL_PUBLIC int
81 ua_ui_window_is_focused(
82 UAUiWindow *window);
83+
84+ UBUNTU_DLL_PUBLIC void
85+ ua_ui_window_request_state(
86+ UAUiWindow *window, UApplicationUiWindowState state);
87
88 UBUNTU_DLL_PUBLIC UApplicationUiWindowOrientation
89 ua_ui_window_get_orientation(
90
91=== modified file 'src/ubuntu/application/base_module.h'
92--- src/ubuntu/application/base_module.h 2014-09-16 19:26:32 +0000
93+++ src/ubuntu/application/base_module.h 2014-10-01 00:44:13 +0000
94@@ -28,7 +28,7 @@
95 */
96
97 #define API_VERSION_MAJOR "2"
98-#define API_VERSION_MINOR "3"
99+#define API_VERSION_MINOR "5"
100 #define API_VERSION_PATCH "0"
101 #define SO_SUFFIX ".so." API_VERSION_MAJOR "." API_VERSION_MINOR "." API_VERSION_PATCH
102
103
104=== modified file 'src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp'
105--- src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp 2014-07-15 12:41:35 +0000
106+++ src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp 2014-10-01 00:44:13 +0000
107@@ -382,5 +382,11 @@
108 return window->is_focused();
109 }
110
111+void ua_ui_window_request_state(UAUiWindow *u_window, UApplicationUiWindowState state)
112+{
113+ auto window = uamc::Window::from_u_window(u_window);
114+ window->set_state(state);
115+}
116+
117 // TODO: Sensors
118 }
119
120=== modified file 'src/ubuntu/application/common/mirclient/window_mirclient.cpp'
121--- src/ubuntu/application/common/mirclient/window_mirclient.cpp 2014-08-27 11:37:07 +0000
122+++ src/ubuntu/application/common/mirclient/window_mirclient.cpp 2014-10-01 00:44:13 +0000
123@@ -156,9 +156,34 @@
124 return static_cast<UApplicationUiWindowState>(mir_surface_get_state(surface.get()));
125 }
126
127+namespace
128+{
129+MirSurfaceState u_state_to_mir_state(UApplicationUiWindowState state)
130+{
131+ switch (state)
132+ {
133+ case U_UNKNOWN_STATE:
134+ // TODO: Logging?
135+ case U_RESTORED_STATE:
136+ return mir_surface_state_restored;
137+ case U_MINIMIZED_STATE:
138+ return mir_surface_state_minimized;
139+ case U_MAXIMIZED_STATE:
140+ return mir_surface_state_maximized;
141+ case U_VERTMAXIMIZED_STATE:
142+ return mir_surface_state_vertmaximized;
143+ case U_FULLSCREEN_STATE:
144+ return mir_surface_state_fullscreen;
145+ default:
146+// TODO: How do we report errors in this context?
147+ return mir_surface_state_restored;
148+ }
149+}
150+}
151+
152 void uamc::Window::set_state(const UApplicationUiWindowState state)
153 {
154- mir_surface_set_state(surface.get(), static_cast<MirSurfaceState>(state));
155+ mir_surface_set_state(surface.get(), u_state_to_mir_state(state));
156 }
157
158 void uamc::Window::get_size(uint32_t *width, uint32_t *height)
159
160=== modified file 'src/ubuntu/application/common/mirclient/window_mirclient_priv.h'
161--- src/ubuntu/application/common/mirclient/window_mirclient_priv.h 2014-08-20 17:13:47 +0000
162+++ src/ubuntu/application/common/mirclient/window_mirclient_priv.h 2014-10-01 00:44:13 +0000
163@@ -60,6 +60,8 @@
164 void show();
165 void request_fullscreen();
166
167+ void set_state(const UApplicationUiWindowState);
168+
169 void get_size(uint32_t *width, uint32_t *height);
170
171 void process_event(const WindowEvent &ev);
172@@ -77,7 +79,6 @@
173 Window& operator=(Window const&) = delete;
174
175 private:
176- void set_state(const UApplicationUiWindowState);
177
178 Instance& instance;
179
180
181=== modified file 'src/ubuntu/application/desktop/module_version.h'
182--- src/ubuntu/application/desktop/module_version.h 2014-09-16 18:48:05 +0000
183+++ src/ubuntu/application/desktop/module_version.h 2014-10-01 00:44:13 +0000
184@@ -1,3 +1,3 @@
185 #define MODULE_VERSION_MAJOR 2
186-#define MODULE_VERSION_MINOR 3
187+#define MODULE_VERSION_MINOR 4
188 #define MODULE_VERSION_PATCH 0
189
190=== modified file 'src/ubuntu/application/testbackend/module_version.h'
191--- src/ubuntu/application/testbackend/module_version.h 2014-09-16 19:03:17 +0000
192+++ src/ubuntu/application/testbackend/module_version.h 2014-10-01 00:44:13 +0000
193@@ -1,3 +1,3 @@
194 #define MODULE_VERSION_MAJOR 2
195-#define MODULE_VERSION_MINOR 3
196+#define MODULE_VERSION_MINOR 4
197 #define MODULE_VERSION_PATCH 0
198
199=== modified file 'src/ubuntu/application/testbackend/test_stubs.cpp'
200--- src/ubuntu/application/testbackend/test_stubs.cpp 2014-08-20 17:13:47 +0000
201+++ src/ubuntu/application/testbackend/test_stubs.cpp 2014-10-01 00:44:13 +0000
202@@ -266,6 +266,10 @@
203 {
204 }
205
206+void ua_ui_window_request_state(UAUiWindow *, UApplicationUiWindowState)
207+{
208+}
209+
210 EGLNativeWindowType ua_ui_window_get_native_type(UAUiWindow*)
211 {
212 return NULL;
213
214=== modified file 'src/ubuntu/application/touch/hybris/ubuntu_application_api_hybris.cpp'
215--- src/ubuntu/application/touch/hybris/ubuntu_application_api_hybris.cpp 2014-08-20 17:13:47 +0000
216+++ src/ubuntu/application/touch/hybris/ubuntu_application_api_hybris.cpp 2014-10-01 00:44:13 +0000
217@@ -107,6 +107,7 @@
218 IMPLEMENT_VOID_FUNCTION1(ua_ui_window_request_fullscreen, UAUiWindow*);
219 IMPLEMENT_FUNCTION1(EGLNativeWindowType, ua_ui_window_get_native_type, UAUiWindow*);
220 IMPLEMENT_FUNCTION1(UApplicationUiWindowOrientation, ua_ui_window_get_orientation, UAUiWindow*);
221+IMPLEMENT_FUNCTION2(void, ua_ui_window_request_state, UAUiWindow*, UApplicationUiWindowState);
222
223 /* -------------------------------------------------------------------------- *
224 * * * * * * * * * * * * * * * Deprecated API * * * * * * * * * * * * * * * * *
225
226=== modified file 'src/ubuntu/application/touch/module_version.h'
227--- src/ubuntu/application/touch/module_version.h 2014-09-16 18:48:05 +0000
228+++ src/ubuntu/application/touch/module_version.h 2014-10-01 00:44:13 +0000
229@@ -1,3 +1,3 @@
230 #define MODULE_VERSION_MAJOR 2
231-#define MODULE_VERSION_MINOR 3
232+#define MODULE_VERSION_MINOR 4
233 #define MODULE_VERSION_PATCH 0
234
235=== modified file 'src/ubuntu/application/ubuntu_application_api.cpp'
236--- src/ubuntu/application/ubuntu_application_api.cpp 2014-09-19 12:16:12 +0000
237+++ src/ubuntu/application/ubuntu_application_api.cpp 2014-10-01 00:44:13 +0000
238@@ -122,6 +122,7 @@
239 IMPLEMENT_VOID_FUNCTION1(ua_ui_window_request_fullscreen, UAUiWindow*);
240 IMPLEMENT_FUNCTION1(EGLNativeWindowType, ua_ui_window_get_native_type, UAUiWindow*);
241 IMPLEMENT_FUNCTION1(UApplicationUiWindowOrientation, ua_ui_window_get_orientation, UAUiWindow*);
242+IMPLEMENT_FUNCTION2(void, ua_ui_window_request_state, UAUiWindow*, UApplicationUiWindowState);
243
244 // Ubuntu Application Sensors
245

Subscribers

People subscribed via source and target branches