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
=== modified file 'src/mirserver/ubuntu_application_api_mirserver.cpp'
--- src/mirserver/ubuntu_application_api_mirserver.cpp 2013-06-17 22:51:21 +0000
+++ src/mirserver/ubuntu_application_api_mirserver.cpp 2013-07-22 23:24:25 +0000
@@ -97,6 +97,13 @@
97 context->input_platform.reset();97 context->input_platform.reset();
98 context->egl_client.reset();98 context->egl_client.reset();
99}99}
100
101void ua_ui_window_mirserver_inject_input(UAUiWindow* u_window, MirEvent *ev)
102{
103 auto window = uams::Window::from_u_window(u_window);
104 window->inject_input(ev);
105}
106
100}107}
101108
102}109}
103110
=== modified file 'src/mirserver/ubuntu_application_api_mirserver_priv.h'
--- src/mirserver/ubuntu_application_api_mirserver_priv.h 2013-06-07 17:54:25 +0000
+++ src/mirserver/ubuntu_application_api_mirserver_priv.h 2013-07-22 23:24:25 +0000
@@ -19,6 +19,9 @@
19#ifndef UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_19#ifndef UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_
20#define UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_20#define UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_
2121
22#include <ubuntu/application/ui/window.h>
23#include <mir_toolkit/event.h>
24
22namespace mir25namespace mir
23{26{
24class DefaultServerConfiguration;27class DefaultServerConfiguration;
@@ -35,6 +38,8 @@
3538
36// Release platform-api ownership of Mir server objects to allow for clean shutdown.39// Release platform-api ownership of Mir server objects to allow for clean shutdown.
37void ua_ui_mirserver_finish();40void ua_ui_mirserver_finish();
41
42void ua_ui_window_mirserver_inject_input(UAUiWindow* window, MirEvent* ev);
38}43}
3944
40#endif // UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_45#endif // UBUNTU_APPLICATION_API_MIRSERVER_PRIV_H_
4146
=== modified file 'src/mirserver/window_mirserver.cpp'
--- src/mirserver/window_mirserver.cpp 2013-06-09 23:54:39 +0000
+++ src/mirserver/window_mirserver.cpp 2013-07-22 23:24:25 +0000
@@ -54,8 +54,8 @@
54 surface(instance.create_surface(properties->surface_parameters())),54 surface(instance.create_surface(properties->surface_parameters())),
55 internal_client(internal_client)55 internal_client(internal_client)
56{56{
57 input_thread = input_platform->create_input_thread(surface->client_input_fd(),57 handle_input_callback = std::bind(ua_ui_window_handle_event, properties->input_cb(), properties->input_context(), std::placeholders::_1);
58 std::bind(ua_ui_window_handle_event, properties->input_cb(), properties->input_context(), std::placeholders::_1));58 input_thread = input_platform->create_input_thread(surface->client_input_fd(), handle_input_callback);
59 input_thread->start();59 input_thread->start();
60}60}
6161
@@ -79,3 +79,8 @@
79{79{
80 return internal_client->egl_native_window(surface);80 return internal_client->egl_native_window(surface);
81}81}
82
83void uams::Window::inject_input(MirEvent *ev)
84{
85 handle_input_callback(ev);
86}
8287
=== modified file 'src/mirserver/window_mirserver_priv.h'
--- src/mirserver/window_mirserver_priv.h 2013-06-09 23:54:51 +0000
+++ src/mirserver/window_mirserver_priv.h 2013-07-22 23:24:25 +0000
@@ -21,6 +21,8 @@
2121
22#include <ubuntu/application/ui/window.h>22#include <ubuntu/application/ui/window.h>
2323
24#include <mir_toolkit/event.h>
25
24#include <EGL/egl.h>26#include <EGL/egl.h>
2527
26#include <stddef.h>28#include <stddef.h>
@@ -72,6 +74,8 @@
72 static Window* from_u_window(UAUiWindow* u_window);74 static Window* from_u_window(UAUiWindow* u_window);
73 75
74 EGLNativeWindowType get_native_type();76 EGLNativeWindowType get_native_type();
77
78 void inject_input(MirEvent *ev);
7579
76protected:80protected:
77 Window(Window const&) = delete;81 Window(Window const&) = delete;
@@ -82,6 +86,8 @@
82 std::shared_ptr< ::mir::shell::Surface> surface;86 std::shared_ptr< ::mir::shell::Surface> surface;
83 std::shared_ptr< ::mir::input::receiver::InputReceiverThread> input_thread;87 std::shared_ptr< ::mir::input::receiver::InputReceiverThread> input_thread;
84 std::shared_ptr< ::mir::graphics::InternalClient> internal_client;88 std::shared_ptr< ::mir::graphics::InternalClient> internal_client;
89
90 std::function<void(MirEvent*)> handle_input_callback;
85};91};
86 92
87}93}

Subscribers

People subscribed via source and target branches