Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: switch from luna-surfacemanager-base to auto-luna-surface-manager #527

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ VIRTUAL-RUNTIME_webos-compositor ?= "luna-surfacemanager"
VIRTUAL-RUNTIME_appinstalld ?= "appinstalld2"
VIRTUAL-RUNTIME_event-monitor-network ?= "event-monitor-network"
VIRTUAL-RUNTIME_surface-manager ?= "luna-surfacemanager-base"
VIRTUAL-RUNTIME_surface-manager-conf ?= "luna-surfacemanager-conf"
VIRTUAL-RUNTIME_surface-manager-extension ?= ""
VIRTUAL-RUNTIME_surface-manager-conf ?= "auto-luna-surface-manager"
VIRTUAL-RUNTIME_surface-manager-extension ?= "auto-luna-surface-manager"
VIRTUAL-RUNTIME_webos-ime ?= ""
VIRTUAL-RUNTIME_novacomd ?= "novacomd"
VIRTUAL-RUNTIME_com.webos.app.browser ?= "com.webos.app.enactbrowser"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ RDEPENDS:${PN} += " \
libqofono \
libconnman-qt \
nemo-qml-plugin-dbus \
luna-surfacemanager-conf \
luna-surfacemanager-base \
"

PV = "0.6-0+git"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2019-2022 LG Electronics, Inc.

SUMMARY = "Surface Manager for webOS Auto Reference UX"
AUTHOR = "Jaeyoon Jung <jaeyoon.jung@lge.com>"
SECTION = "webos/base"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = " \
file://LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10 \
file://oss-pkg-info.yaml;md5=1bbf047e5c70344c074aaaa58a668952 \
"

DEPENDS = "luna-surfacemanager qt-features-webos"
RDEPENDS:${PN} = " \
luna-surfacemanager-base \
qtbase-plugins-webos \
"

SRCREV = "52ae0dcd3b1923bce9287bb1923fcd45871b318c"
PV = "0.0.1-39+git${SRCPV}"
PR = "r7"

inherit webos_qmake6
inherit webos_public_repo
# many failures like:
# usr/lib/qml/WebOSCompositor/AutoRSE/WebOSCompositor/views/WebOSAutoSystemUISurface.qml:21:1: SystemUISurface was not found. Did you add all import paths?
# SystemUISurface {
# ^^^^^^^^^^^^^^^
# inherit webos_qmllint
inherit webos_system_bus

SRC_URI = "${WEBOSOSE_GIT_REPO_COMPLETE}"
S = "${WORKDIR}/git"

OE_QMAKE_PATH_HEADERS = "${OE_QMAKE_PATH_QT_HEADERS}"

# Perform extra QML validation
WEBOS_QMLLINT_EXTRA_VALIDATION = "1"

WEBOS_SYSTEM_BUS_SKIP_DO_TASKS = "1"

FILES:${PN} += " \
${OE_QMAKE_PATH_QML}/WebOSCompositor \
${OE_QMAKE_PATH_PLUGINS}/compositor \
"

# Doesn't respect libdir variable and installs in ${base_libdir}/plugins instead of OE_QMAKE_PATH_PLUGINS (${libdir}/plugins)
# which doesn't case issue in OSE due to usrmerge
FILES:${PN} += " \
${base_libdir}/plugins/compositor \
"
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ FILES:${PN}-base += " \
${OE_QMAKE_PATH_BINS}/ \
${datadir}/icons/ \
${datadir}/webos-keymap/webos-keymap.qmap \
"

FILES:${PN}-base-conf += " \
${sysconfdir}/surface-manager.d/ \
${webos_sysbus_apipermissionsdir} \
${webos_sysbus_groupsdir} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ PACKAGECONFIG ??= ""
# Emulator
PACKAGECONFIG[emulator] = "CONFIG+=emulator,,nyx-lib"
PACKAGECONFIG:append:emulator = " emulator"
PACKAGECONFIG:append:qemuall = " emulator"
SRC_URI:append:qemuall = " \
file://0001-virtual-touch-for-emulator.patch \
file://0002-Disable-mouse-wheel-on-touch-mode-for-emulator.patch \
"

# Multi-plane composition
PACKAGECONFIG[plane-composition] = "CONFIG+=plane_composition,,"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
From c4df08911d1e6ead0f17c7bcaa8398cbd0ce3ff7 Mon Sep 17 00:00:00 2001
From: Heegoo Han <heegoo.han@lge.com>
Date: Thu, 4 Nov 2021 16:14:14 +0900
Subject: [PATCH] virtual touch for emulator

---
src/eglfs_webos/weboseglfsintegration.cpp | 73 ++++++++++++++++++++++-
src/eglfs_webos/weboseglfsintegration.h | 2 -
2 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/src/eglfs_webos/weboseglfsintegration.cpp b/src/eglfs_webos/weboseglfsintegration.cpp
index 56f4671..2c00a3f 100644
--- a/src/eglfs_webos/weboseglfsintegration.cpp
+++ b/src/eglfs_webos/weboseglfsintegration.cpp
@@ -127,6 +127,77 @@ void WebOSEglFSIntegration::createInputHandlers()
if ((m_emulatorKeyboardManager) && (m_emulatorMouseManager)) {
connect(m_emulatorKeyboardManager, &QEmulatorKeyboardManager::handleKeycodeSignal, m_emulatorMouseManager, &QEmulatorMouseManager::handleKeycodeSlot);
}
+
+ // HACK: implement virtual touch for emulator.
+ QOutputMapping::set(&m_mappingHelper);
+
+ if (!m_configJson.isEmpty()) {
+ for (int i = 0; i < m_configJson.array().size(); i++) {
+ const QJsonObject object = m_configJson.array().at(i).toObject();
+ const QJsonArray outputs = object.value(QLatin1String("outputs")).toArray();
+ for (int j = 0; j < outputs.size(); j++) {
+ const QJsonObject output = outputs.at(j).toObject();
+ if (!m_useFixedAssociationForTouch) {
+ QString touchDevice = output.value(QLatin1String("touchDevice")).toString();
+ if (!touchDevice.isEmpty())
+ m_useFixedAssociationForTouch = true;
+ }
+
+ const QVariantMap outputSettings = outputs.at(j).toObject().toVariantMap();
+ if (outputSettings.contains(QStringLiteral("name"))) {
+ const QString name = outputSettings.value(QStringLiteral("name")).toString();
+ if (m_outputSettings.contains(name))
+ qWarning() << "Output" << name << "is duplicated";
+ m_outputSettings.insert(name, outputSettings);
+ }
+ }
+ }
+ }
+
+ qDebug() << "useFixedAssociationForTouch:" << m_useFixedAssociationForTouch;
+
+ m_touchDiscovery = WebOSDeviceDiscoveryUDevSorted::create(QDeviceDiscovery::Device_Touchpad | QDeviceDiscovery::Device_Touchscreen, this);
+
+ QStringList scannedTouchDevices = m_touchDiscovery->scanConnectedDevices();
+ if (m_useFixedAssociationForTouch)
+ prepareFixedOutputMapping(scannedTouchDevices, QLatin1String("touchDevice"));
+ else
+ prepareOutputMapping(scannedTouchDevices);
+
+ QString touchDevs = initializeDevices(scannedTouchDevices);
+
+ bool useDummyTouchDevice = false;
+ // to disable device discovery in QEvdevTouchManager when no device is connected.
+ if (touchDevs.isEmpty()) {
+ touchDevs = "/dev/null";
+ useDummyTouchDevice = true;
+ }
+
+ QString env = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
+ qDebug() << "createInputHandlers, touchDevs" << touchDevs << env;
+ if (!env.isEmpty()) {
+ env.append(":" + touchDevs);
+ qWarning() << "Updating QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS to" << env;
+ qputenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS", env.toUtf8());
+ }
+
+ m_touchMgr = new QEvdevTouchManager(QLatin1String("EvdevTouch"), touchDevs, this);
+ // Remove the null device to prevent reading it
+ if (m_touchMgr && useDummyTouchDevice)
+ m_touchMgr->removeDevice("/dev/null");
+
+ if (m_touchDiscovery && m_touchMgr) {
+ connect(m_touchDiscovery, &QDeviceDiscovery::deviceDetected,
+ this, &WebOSEglFSIntegration::arrangeTouchDevices);
+ connect(m_touchDiscovery, &QDeviceDiscovery::deviceRemoved,
+ this, &WebOSEglFSIntegration::removeTouchDevice);
+ }
+
+ connect(this, &WebOSEglFSIntegration::platformWindowCreated, this, &WebOSEglFSIntegration::handleWindowCreated);
+
+ m_initTimer.setSingleShot(true);
+ connect(&m_initTimer, &QTimer::timeout, this, &WebOSEglFSIntegration::updateWindowMapping);
+ // End of HACK:
}
#else
void WebOSEglFSIntegration::createInputHandlers()
@@ -245,6 +316,7 @@ void WebOSEglFSIntegration::createInputHandlers()
m_initTimer.setSingleShot(true);
connect(&m_initTimer, &QTimer::timeout, this, &WebOSEglFSIntegration::updateWindowMapping);
}
+#endif

QPlatformWindow *WebOSEglFSIntegration::createPlatformWindow(QWindow *window) const
{
@@ -277,7 +349,6 @@ void WebOSEglFSIntegration::updateWindowMapping()
arrangeTouchDevices();
arrangeKbdDevices();
}
-#endif

void WebOSEglFSIntegration::prepareOutputMapping(const QStringList &devices)
{
diff --git a/src/eglfs_webos/weboseglfsintegration.h b/src/eglfs_webos/weboseglfsintegration.h
index 0777721..b14747e 100644
--- a/src/eglfs_webos/weboseglfsintegration.h
+++ b/src/eglfs_webos/weboseglfsintegration.h
@@ -66,7 +66,6 @@ public:
void removeTouchDevice(const QString &deviceNode);
void arrangeKbdDevices();
void removeKbdDevice(const QString &deviceNode);
-#if not defined(EMULATOR)
QPlatformWindow *createPlatformWindow(QWindow *window) const override;

public slots:
@@ -76,7 +75,6 @@ public slots:

signals:
void platformWindowCreated(QWindow *) const;
-#endif

private:
QVector<QWindow *> m_windows;
--
2.17.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 9f72100e7b318942b55f7a11bded8c2235a967cd Mon Sep 17 00:00:00 2001
From: "sc.heo" <sc.heo@lge.com>
Date: Tue, 8 Mar 2022 17:56:04 +0900
Subject: [PATCH] Disable mouse wheel on touch mode for emulator

---
src/eglfs_webos/emulator/qemulatormousemanager.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/eglfs_webos/emulator/qemulatormousemanager.cpp b/src/eglfs_webos/emulator/qemulatormousemanager.cpp
index 7b0e780..c333473 100644
--- a/src/eglfs_webos/emulator/qemulatormousemanager.cpp
+++ b/src/eglfs_webos/emulator/qemulatormousemanager.cpp
@@ -261,7 +261,17 @@ void QEmulatorMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseBu
void QEmulatorMouseManager::handleWheelEvent(QPoint delta)
{
QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
- QWindowSystemInterface::handleWheelEvent(0, pos, pos, QPoint(), delta, QGuiApplicationPrivate::inputDeviceManager()->keyboardModifiers());
+
+ // In emulator, we don't have touch screen and we use mouse as input of both mouse and touch input.
+ // So we made 2 mode(mouse mode, touch simulation mode).Default is touch simulation mode. You can change mouse mode via left Alt key.
+ // Touch simulation mode means that we covert mouse event into touch event.
+ // If we use mouse wheel and touch input together, wheel is not working correctly.
+ // So we disable mouse wheel on touch simulation mode, only process mouse wheel on touch mode.
+ if (!m_isTouch) {//mouse mode
+ QWindowSystemInterface::handleWheelEvent(0, pos, pos, QPoint(), delta, QGuiApplicationPrivate::inputDeviceManager()->keyboardModifiers());
+ } else{//touch simulation mode
+ qWarning("In emulator, no process WheelEvent on touch simulation mode");
+ }
}

void QEmulatorMouseManager::addMouse(const QString &deviceNode)
--
2.17.1

8 changes: 3 additions & 5 deletions meta-luneui/classes/webos_filesystem_paths.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ webos_applicationsdir = "${prefix}/palm/applications"
webos_frameworksdir = "${prefix}/palm/frameworks"
webos_keysdir = "${prefix}/palm/data"
# This is the location of the pre-installed catalog apps IPKs
# FIXME check if we can use new value
# New value - webos_picapkgdir = "${webos_mntdir}/pica"
export webos_picapkgdir = "${prefix}/palm/ipkgs"
webos_picapkgdir = "${webos_mntdir}/pica"
# This is the location of webOS application plugins. There is a subdirectory for
# each application that is named using the final field of its complete name.
webos_pluginsdir = "${prefix}/palm/plugins"
Expand Down Expand Up @@ -171,8 +169,8 @@ webos_emulatorshareddir = "${webos_mediadir}/shared"
# The presence of this file indicates that First Use has been completed.
webos_firstusesentinelfile = "${webos_sysmgr_localstatedir}/preferences/ran-firstuse"

# Note that everything under localstatedir is erased by a NYX_SYSTEM_ERASE_VAR erasure.
webos_crashddir = "${webos_logdir}/crashd"
# SDK tools
webos_sdkdir = "${webos_optdir}/webos/sdk"

# SDK tools
webos_sdkdir = "${webos_optdir}/webos/sdk"
Expand Down