Merge lp:~robertcarr/platform-api/add-input-injection into lp:platform-api

Proposed by Robert Carr
Status: Rejected
Rejected by: Robert Carr
Proposed branch: lp:~robertcarr/platform-api/add-input-injection
Merge into: lp:platform-api
Diff against target: 95 lines (+25/-2)
4 files modified
src/mirserver/ubuntu_application_api_mirserver.cpp (+7/-0)
src/mirserver/ubuntu_application_api_mirserver_priv.h (+5/-0)
src/mirserver/window_mirserver.cpp (+7/-2)
src/mirserver/window_mirserver_priv.h (+6/-0)
To merge this branch: bzr merge lp:~robertcarr/platform-api/add-input-injection
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+176302@code.launchpad.net

Commit message

Add input injection API on mirserver

Description of the change

I am told for the Unity 8 gesture recognizer as it is written now to work we need to be able to send all events to a surface. Mir has support abstractly for interfering with the input stream, but not for "monitor surfaces". This API provides a backdoor where the shell can implement an mi::EventFilter and use it to inject in to Qt.

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
Robert Carr (robertcarr) wrote :

It seems this may not be enough due to a misunderstanding on my part.

Unmerged revisions

98. By Robert Carr

Add private input injection API to mirserver

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mirserver/ubuntu_application_api_mirserver.cpp'
2--- src/mirserver/ubuntu_application_api_mirserver.cpp 2013-06-17 22:51:21 +0000
3+++ src/mirserver/ubuntu_application_api_mirserver.cpp 2013-07-22 23:24:25 +0000
4@@ -97,6 +97,13 @@
5 context->input_platform.reset();
6 context->egl_client.reset();
7 }
8+
9+void ua_ui_window_mirserver_inject_input(UAUiWindow* u_window, MirEvent *ev)
10+{
11+ auto window = uams::Window::from_u_window(u_window);
12+ window->inject_input(ev);
13+}
14+
15 }
16
17 }
18
19=== modified file 'src/mirserver/ubuntu_application_api_mirserver_priv.h'
20--- src/mirserver/ubuntu_application_api_mirserver_priv.h 2013-06-07 17:54:25 +0000
21+++ src/mirserver/ubuntu_application_api_mirserver_priv.h 2013-07-22 23:24:25 +0000
22@@ -19,6 +19,9 @@
23 #ifndef UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_
24 #define UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_
25
26+#include <ubuntu/application/ui/window.h>
27+#include <mir_toolkit/event.h>
28+
29 namespace mir
30 {
31 class DefaultServerConfiguration;
32@@ -35,6 +38,8 @@
33
34 // Release platform-api ownership of Mir server objects to allow for clean shutdown.
35 void ua_ui_mirserver_finish();
36+
37+void ua_ui_window_mirserver_inject_input(UAUiWindow* window, MirEvent* ev);
38 }
39
40 #endif // UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_
41
42=== modified file 'src/mirserver/window_mirserver.cpp'
43--- src/mirserver/window_mirserver.cpp 2013-06-09 23:54:39 +0000
44+++ src/mirserver/window_mirserver.cpp 2013-07-22 23:24:25 +0000
45@@ -54,8 +54,8 @@
46 surface(instance.create_surface(properties->surface_parameters())),
47 internal_client(internal_client)
48 {
49- input_thread = input_platform->create_input_thread(surface->client_input_fd(),
50- std::bind(ua_ui_window_handle_event, properties->input_cb(), properties->input_context(), std::placeholders::_1));
51+ handle_input_callback = std::bind(ua_ui_window_handle_event, properties->input_cb(), properties->input_context(), std::placeholders::_1);
52+ input_thread = input_platform->create_input_thread(surface->client_input_fd(), handle_input_callback);
53 input_thread->start();
54 }
55
56@@ -79,3 +79,8 @@
57 {
58 return internal_client->egl_native_window(surface);
59 }
60+
61+void uams::Window::inject_input(MirEvent *ev)
62+{
63+ handle_input_callback(ev);
64+}
65
66=== modified file 'src/mirserver/window_mirserver_priv.h'
67--- src/mirserver/window_mirserver_priv.h 2013-06-09 23:54:51 +0000
68+++ src/mirserver/window_mirserver_priv.h 2013-07-22 23:24:25 +0000
69@@ -21,6 +21,8 @@
70
71 #include <ubuntu/application/ui/window.h>
72
73+#include <mir_toolkit/event.h>
74+
75 #include <EGL/egl.h>
76
77 #include <stddef.h>
78@@ -72,6 +74,8 @@
79 static Window* from_u_window(UAUiWindow* u_window);
80
81 EGLNativeWindowType get_native_type();
82+
83+ void inject_input(MirEvent *ev);
84
85 protected:
86 Window(Window const&) = delete;
87@@ -82,6 +86,8 @@
88 std::shared_ptr< ::mir::shell::Surface> surface;
89 std::shared_ptr< ::mir::input::receiver::InputReceiverThread> input_thread;
90 std::shared_ptr< ::mir::graphics::InternalClient> internal_client;
91+
92+ std::function<void(MirEvent*)> handle_input_callback;
93 };
94
95 }

Subscribers

People subscribed via source and target branches