mirror of
https://github.com/openharmony/third_party_weston.git
synced 2026-06-30 22:07:56 -04:00
@@ -1,4 +1,5 @@
|
||||
import("//build/ohos.gni")
|
||||
import("//foundation/multimodalinput/input/multimodalinput_mini.gni")
|
||||
import("//third_party/wayland_standard/wayland_protocol.gni")
|
||||
|
||||
group("default") {
|
||||
@@ -151,8 +152,8 @@ ohos_shared_library("libweston") {
|
||||
|
||||
deps = [
|
||||
":trace",
|
||||
"//foundation/multimodalinput/input/patch/diff_libinput_mmi:libinput-third-mmi",
|
||||
"//third_party/libdrm:libdrm",
|
||||
"//third_party/libinput:libinput-third",
|
||||
"//utils/native/base:utils",
|
||||
]
|
||||
|
||||
@@ -221,7 +222,7 @@ ohos_static_library("libexec_weston") {
|
||||
":trace",
|
||||
":weston_screenshooter_protocol",
|
||||
"//foundation/graphic/standard/frameworks/vsync:libvsync_module",
|
||||
"//third_party/libinput:libinput-third",
|
||||
"//foundation/multimodalinput/input/patch/diff_libinput_mmi:libinput-third-mmi",
|
||||
"//third_party/wayland-protocols_standard:input_method_unstable_v1_protocol",
|
||||
"//third_party/wayland-protocols_standard:text_input_unstable_v1_protocol",
|
||||
]
|
||||
@@ -425,14 +426,18 @@ ohos_shared_library("drm-backend") {
|
||||
":libweston",
|
||||
":trace",
|
||||
"//foundation/graphic/standard/frameworks/vsync:libvsync_module",
|
||||
"//foundation/multimodalinput/input/patch/diff_libinput_mmi:libinput-third-mmi",
|
||||
"//third_party/libdrm:libdrm",
|
||||
"//third_party/libinput:libinput-third",
|
||||
"//third_party/wayland-protocols_standard:linux_dmabuf_unstable_v1_protocol",
|
||||
"//third_party/wayland-protocols_standard:presentation_time_protocol",
|
||||
"//third_party/wayland-protocols_standard:relative_pointer_unstable_v1_protocol",
|
||||
"//third_party/wayland_standard:wayland_core_protocol",
|
||||
]
|
||||
|
||||
if (is_mmi_have_hdf) {
|
||||
defines = [ "LIBINPUT_THIRD_HDF" ]
|
||||
}
|
||||
|
||||
public_deps = []
|
||||
|
||||
part_name = "graphic_standard"
|
||||
|
||||
+28
-18
@@ -385,31 +385,41 @@ static const struct weston_touch_device_ops touch_calibration_ops = {
|
||||
static struct weston_touch_device *
|
||||
create_touch_device(struct evdev_device *device)
|
||||
{
|
||||
const struct weston_touch_device_ops *ops = NULL;
|
||||
struct weston_touch_device *touch_device;
|
||||
struct udev_device *udev_device;
|
||||
const struct weston_touch_device_ops *ops = NULL;
|
||||
struct weston_touch_device *touch_device;
|
||||
#ifndef LIBINPUT_THIRD_HDF
|
||||
struct udev_device *udev_device;
|
||||
#endif
|
||||
|
||||
if (libinput_device_config_calibration_has_matrix(device->device))
|
||||
ops = &touch_calibration_ops;
|
||||
if (libinput_device_config_calibration_has_matrix(device->device))
|
||||
ops = &touch_calibration_ops;
|
||||
|
||||
udev_device = libinput_device_get_udev_device(device->device);
|
||||
if (!udev_device)
|
||||
return NULL;
|
||||
#ifndef LIBINPUT_THIRD_HDF
|
||||
udev_device = libinput_device_get_udev_device(device->device);
|
||||
if (!udev_device)
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
touch_device = weston_touch_create_touch_device(device->seat->touch_state,
|
||||
udev_device_get_syspath(udev_device),
|
||||
device, ops);
|
||||
touch_device = weston_touch_create_touch_device(device->seat->touch_state,
|
||||
#ifndef LIBINPUT_THIRD_HDF
|
||||
udev_device_get_syspath(udev_device),
|
||||
#else
|
||||
"hdf",
|
||||
#endif
|
||||
device, ops);
|
||||
|
||||
udev_device_unref(udev_device);
|
||||
#ifndef LIBINPUT_THIRD_HDF
|
||||
udev_device_unref(udev_device);
|
||||
#endif
|
||||
|
||||
if (!touch_device)
|
||||
return NULL;
|
||||
if (!touch_device)
|
||||
return NULL;
|
||||
|
||||
weston_log("Touchscreen - %s - %s\n",
|
||||
libinput_device_get_name(device->device),
|
||||
touch_device->syspath);
|
||||
weston_log("Touchscreen - %s - %s\n",
|
||||
libinput_device_get_name(device->device),
|
||||
touch_device->syspath);
|
||||
|
||||
return touch_device;
|
||||
return touch_device;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+34
-16
@@ -212,25 +212,43 @@ process_event(struct libinput_event *event)
|
||||
return;
|
||||
}
|
||||
|
||||
bool
|
||||
is_touch_active(struct libinput_event* event)
|
||||
{
|
||||
if (!event) {
|
||||
return false;
|
||||
}
|
||||
enum libinput_event_type type = libinput_event_get_type(event);
|
||||
if (type == LIBINPUT_EVENT_TOUCH_DOWN || type == LIBINPUT_EVENT_TOUCH_MOTION) {
|
||||
struct libinput_device *libinput_dev = libinput_event_get_device(event);
|
||||
if (!libinput_dev) {
|
||||
return false;
|
||||
}
|
||||
struct evdev_device *device = libinput_device_get_user_data(libinput_dev);
|
||||
if (!device || !device->output) {
|
||||
return false;
|
||||
}
|
||||
struct weston_touch *touch = device->touch_device->aggregate;
|
||||
if (!touch || !weston_touch_has_focus_resource(touch)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
process_events(struct udev_input *input)
|
||||
{
|
||||
struct libinput_event *event;
|
||||
|
||||
while ((event = libinput_get_event(input->libinput))) {
|
||||
process_event(event);
|
||||
// for multi model input.
|
||||
if (g_libinput_event_listener)
|
||||
{
|
||||
weston_log("process_events: call libinput_event_listener.\n");
|
||||
g_libinput_event_listener(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
weston_log("process_events: libinput_event_listener is not set.\n");
|
||||
}
|
||||
libinput_event_destroy(event);
|
||||
}
|
||||
struct libinput_event *event = NULL;
|
||||
while ((event = libinput_get_event(input->libinput))) {
|
||||
process_event(event);
|
||||
if (g_libinput_event_listener && is_touch_active(event)) {
|
||||
g_libinput_event_listener(event);
|
||||
} else {
|
||||
weston_log("process_events: libinput_event_listener is not set.\n");
|
||||
}
|
||||
libinput_event_destroy(event);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[core]
|
||||
shell=libivi-shell.z.so
|
||||
modules=libivi-controller.z.so,libwmserver.z.so
|
||||
modules=libivi-controller.z.so,libwmserver.z.so,libmmi-server.z.so
|
||||
|
||||
[ivi-shell]
|
||||
ivi-input-module=libivi-input-controller.z.so
|
||||
|
||||
Reference in New Issue
Block a user