From owner-dev-commits-ports-all@freebsd.org Fri Apr 30 15:29:39 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C521962281B; Fri, 30 Apr 2021 15:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWxBC55Ghz4rX5; Fri, 30 Apr 2021 15:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A107E2E6A5; Fri, 30 Apr 2021 15:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13UFTdTA019976; Fri, 30 Apr 2021 15:29:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UFTdoE019975; Fri, 30 Apr 2021 15:29:39 GMT (envelope-from git) Date: Fri, 30 Apr 2021 15:29:39 GMT Message-Id: <202104301529.13UFTdoE019975@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Adriaan de Groot Subject: git: ba447816c037 - main - x11-wm/plasma5-kwin: improve Wayland support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adridg X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba447816c037c00e0540fa28678f860e4175bd67 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 15:29:39 -0000 The branch main has been updated by adridg: URL: https://cgit.FreeBSD.org/ports/commit/?id=ba447816c037c00e0540fa28678f860e4175bd67 commit ba447816c037c00e0540fa28678f860e4175bd67 Author: Adriaan de Groot AuthorDate: 2021-04-27 13:07:56 +0000 Commit: Adriaan de Groot CommitDate: 2021-04-30 15:29:36 +0000 x11-wm/plasma5-kwin: improve Wayland support This is a backport / newly-developed patches for KDE Plasma Wayland on FreeBSD. Some parts are upstream. - Shuffle the USE_KDE line around a bit to make clear what the direct Wayland-dependencies are; also add the ones that were missing for full Wayland functionality. - The major() and minor() macros on FreeBSD have "return type" int, while on Linux they are "unsigned int" (see makedev(3) for details). When passed to QVariant without a cast, that leads to type-mismatches in DBus messages. - ConsoleKit returns a new seat, but that seat does not receive the libinput devices and never gets any input. Hard-code "seat0" since this codepath is Wayland-only. - Fix build on i386 (but really, modern X11/Wayland desktop on i386 seems like a really, **really** unlikely combination). --- x11-wm/plasma5-kwin/Makefile | 20 ++--- x11-wm/plasma5-kwin/files/patch-git-e940f73963 | 104 +++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 10 deletions(-) diff --git a/x11-wm/plasma5-kwin/Makefile b/x11-wm/plasma5-kwin/Makefile index d861a43bc8c0..fceab4c12ef4 100644 --- a/x11-wm/plasma5-kwin/Makefile +++ b/x11-wm/plasma5-kwin/Makefile @@ -1,6 +1,6 @@ PORTNAME= kwin DISTVERSION= ${KDE_PLASMA_VERSION} -PORTREVISION= 1 +PORTREVISION= 4 CATEGORIES= x11-wm kde kde-plasma MAINTAINER= kde@FreeBSD.org @@ -24,8 +24,10 @@ LIB_DEPENDS= libXcursor.so:x11/libXcursor \ libxcb-keysyms.so:x11/xcb-util-keysyms \ libxkbcommon.so:x11/libxkbcommon BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto \ - xwayland-devel>0:x11-servers/xwayland-devel -RUN_DEPENDS= xwayland-devel>0:x11-servers/xwayland-devel + xwayland-devel>0:x11-servers/xwayland-devel \ + ${kde-kwayland-protocols_LIB}:${kde-kwayland-protocols_PORT} +RUN_DEPENDS= xwayland-devel>0:x11-servers/xwayland-devel \ + ${kde-kwayland-protocols_LIB}:${kde-kwayland-protocols_PORT} USES= cmake compiler:c++11-lib cpe gettext gl gnome kde:5 pkgconfig python:3.5+,run \ qt:5 shebangfix tar:xz xorg @@ -33,10 +35,12 @@ USE_GL= egl USE_GNOME= glib20 USE_KDE= activities activities attica auth breeze codecs \ completion config configwidgets coreaddons crash decoration \ - doctools_build globalaccel i18n iconthemes idletime init \ - jobwidgets kcmutils kdeclarative kio kwayland-server kscreenlocker \ + globalaccel i18n iconthemes idletime init \ + jobwidgets kcmutils kdeclarative kio kscreenlocker \ newstuff notifications package plasma-framework runner service sonnet \ - textwidgets wayland widgetsaddons windowsystem xmlgui + textwidgets widgetsaddons windowsystem xmlgui \ + kwayland-integration kwayland-server wayland \ + doctools_build USE_LDCONFIG= yes USE_QT= concurrent core dbus declarative gui multimedia network script \ sensors testlib uiplugin uitools widgets x11extras xml \ @@ -46,8 +50,4 @@ USE_XORG= ice sm x11 xcb xext xi SHEBANG_FILES= kconf_update/*.py \ kconf_update/*.pl -post-patch: - ${REINPLACE_CMD} '/sysmacros.h/d' \ - ${PATCH_WRKSRC}/logind.cpp - .include diff --git a/x11-wm/plasma5-kwin/files/patch-git-e940f73963 b/x11-wm/plasma5-kwin/files/patch-git-e940f73963 new file mode 100644 index 000000000000..4f00660e6bc9 --- /dev/null +++ b/x11-wm/plasma5-kwin/files/patch-git-e940f73963 @@ -0,0 +1,104 @@ +diff --git libinput/context.cpp libinput/context.cpp +index 00aa98490..f239c8967 100644 +--- libinput/context.cpp ++++ libinput/context.cpp +@@ -63,6 +63,13 @@ bool Context::assignSeat(const char *seat) + if (!isValid()) { + return false; + } ++#if defined(Q_OS_FREEBSD) ++ // On FreeBSD, seat-assignment does work; when assigning ++ // to a different seat, no input devices are ever reported. ++ // Using the default seat **does** return devices, so ++ // use that instead. ++ seat = "seat0"; ++#endif + return libinput_udev_assign_seat(m_libinput, seat) == 0; + } + +diff --git logind.cpp logind.cpp +index cf5266b68..da77a3a59 100644 +--- logind.cpp ++++ logind.cpp +@@ -356,6 +356,11 @@ void LogindIntegration::releaseControl() + emit hasSessionControlChanged(false); + } + ++static QVariantList fromRDev(const dev_t rdev) ++{ ++ return QVariantList({quint32(major(rdev)), quint32(minor(rdev))}); ++} ++ + int LogindIntegration::takeDevice(const char *path) + { + struct stat st; +@@ -367,7 +372,7 @@ int LogindIntegration::takeDevice(const char *path) + m_sessionPath, + m_sessionControllerSessionInterface, + QStringLiteral("TakeDevice")); +- message.setArguments(QVariantList({QVariant(major(st.st_rdev)), QVariant(minor(st.st_rdev))})); ++ message.setArguments(fromRDev(st.st_rdev)); + // intended to be a blocking call + QDBusMessage reply = m_bus.call(message); + if (reply.type() == QDBusMessage::ErrorMessage) { +@@ -389,7 +394,7 @@ void LogindIntegration::releaseDevice(int fd) + m_sessionPath, + m_sessionControllerSessionInterface, + QStringLiteral("ReleaseDevice")); +- message.setArguments(QVariantList({QVariant(major(st.st_rdev)), QVariant(minor(st.st_rdev))})); ++ message.setArguments(fromRDev(st.st_rdev)); + m_bus.asyncCall(message); + } + close(fd); +diff --git main_wayland.cpp main_wayland.cpp +index b73ed09c9..a59dba849 100644 +--- main_wayland.cpp ++++ main_wayland.cpp +@@ -776,6 +776,15 @@ int main(int argc, char * argv[]) + a.platform()->setInitialOutputCount(outputCount); + + QObject::connect(&a, &KWin::Application::workspaceCreated, server, &KWin::WaylandServer::initWorkspace); ++ ++ // If startup doesn't complete within 20 seconds, exit rather than hanging ++ // around forever (e.g. if workspace creation can't happen due to DBus errors) ++ QTimer* startupTimeout = new QTimer; ++ QObject::connect(startupTimeout, &QTimer::timeout, [&](){ a.exit(2); }); ++ QObject::connect(&a, &KWin::Application::workspaceCreated, [&](){ startupTimeout->stop(); delete startupTimeout; }); ++ startupTimeout->setSingleShot(true); ++ startupTimeout->start(std::chrono::seconds(20)); ++ + if (!server->socketName().isEmpty()) { + environment.insert(QStringLiteral("WAYLAND_DISPLAY"), server->socketName()); + } +diff --git plugins/platforms/drm/drm_backend.cpp plugins/platforms/drm/drm_backend.cpp +index cdf4bf689..0eb6d45d3 100644 +--- plugins/platforms/drm/drm_backend.cpp ++++ plugins/platforms/drm/drm_backend.cpp +@@ -244,7 +244,7 @@ void DrmBackend::pageFlipHandler(int fd, unsigned int frame, unsigned int sec, u + + std::chrono::nanoseconds timestamp = convertTimestamp(gpu->presentationClock(), + CLOCK_MONOTONIC, +- { sec, usec * 1000 }); ++ { static_cast(sec), static_cast(usec * 1000) }); + if (timestamp == std::chrono::nanoseconds::zero()) { + qCDebug(KWIN_DRM, "Got invalid timestamp (sec: %u, usec: %u) on output %s", + sec, usec, qPrintable(output->name())); +diff --git tabletmodemanager.cpp tabletmodemanager.cpp +index e23d91ec0..3b20cc4b2 100644 +--- tabletmodemanager.cpp ++++ tabletmodemanager.cpp +@@ -60,9 +60,11 @@ public: + : QObject(parent) + , m_parent(parent) + { +- auto c = LibInput::Connection::self(); +- connect(c, &LibInput::Connection::deviceAdded, this, &TabletModeTouchpadRemovedSpy::refresh); +- connect(c, &LibInput::Connection::deviceRemoved, this, &TabletModeTouchpadRemovedSpy::refresh); ++ auto c = LibInput::Connection::self(); // May be nullptr ++ if (c) { ++ connect(c, &LibInput::Connection::deviceAdded, this, &TabletModeTouchpadRemovedSpy::refresh); ++ connect(c, &LibInput::Connection::deviceRemoved, this, &TabletModeTouchpadRemovedSpy::refresh); ++ } + + check(); + }