diff --git a/x11-wm/kwinft/Makefile b/x11-wm/kwinft/Makefile index 4c84f53db734..7ff6452443dd 100644 --- a/x11-wm/kwinft/Makefile +++ b/x11-wm/kwinft/Makefile @@ -1,72 +1,72 @@ PORTNAME= kwinft DISTVERSIONPREFIX= ${PORTNAME}@ DISTVERSION= 5.27.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-wm wayland MAINTAINER= jbeich@FreeBSD.org COMMENT= Wayland compositor and X11 window manager WWW= https://gitlab.com/kwinft/kwinft LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto LIB_DEPENDS= libepoxy.so:graphics/libepoxy \ libwayland-server.so:graphics/wayland \ libWraplandServer.so:graphics/wrapland \ libfreetype.so:print/freetype2 \ libfontconfig.so:x11-fonts/fontconfig \ libwlroots.so:x11-toolkits/wlroots \ libinput.so:x11/libinput \ libxkbcommon.so:x11/libxkbcommon \ libxcb-cursor.so:x11/xcb-util-cursor \ libxcb-image.so:x11/xcb-util-image \ libxcb-keysyms.so:x11/xcb-util-keysyms \ libxcb-icccm.so:x11/xcb-util-wm TEST_DEPENDS= ${qt-testlib_PORT:T}>0:${qt-testlib_PORT} CONFLICTS_INSTALL= plasma5-kwin # bin/kwin_wayland USES= cmake:testing gl kde:5 pkgconfig python:run qt:5 shebangfix xorg USE_GITLAB= yes USE_GL= egl USE_KDE= ecm:build auth config configwidgets \ coreaddons crash dbusaddons decoration globalaccel i18n \ idletime kcmutils kdeclarative kio kscreenlocker newstuff \ notifications package plasma-framework service \ widgetsaddons windowsystem xmlgui USE_LDCONFIG= yes USE_QT= qmake:build buildtools:build core dbus declarative gui \ multimedia:run quickcontrols2:run widgets x11extras USE_XORG= pixman x11 xcb xi SHEBANG_FILES= effect/effects/*.py kconf_update/*.py kconf_update/*.pl GL_COMMIT= 6d47e3aebd58ea1e7556c67e0f7870e874922f7c PLIST_SUB= VERSION=${PORTVERSION} LDFLAGS+= -Wl,--as-needed # GL, ICE/SM/Xext, glib, intl, Qt5*, KF5* OPTIONS_DEFINE= BREEZE DOCS QA11Y OPTIONS_DEFAULT=BREEZE QA11Y BREEZE_DESC= Default window decoration plugin BREEZE_USE= KDE=breeze BREEZE_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Breeze DOCS_USE= KDE=doctools:build DOCS_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_KF5DocTools QA11Y_DESC= Accessibility (focus tracking) for Zoom effect QA11Y_LIB_DEPENDS= libqaccessibilityclient-qt5.so:accessibility/libqaccessibilityclient QA11Y_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_QAccessibilityClient post-patch: # Convert nodes from linprocfs(5) to procfs(5) # XXX kwinft lacks https://invent.kde.org/plasma/kwin/-/commit/1bc7afe8aaa9 @${REINPLACE_CMD} -e '/proc/,+1s,/exe,/file,' \ ${WRKSRC}/base/wayland/filtered_display.cpp \ ${WRKSRC}/desktop/kde/service_utils.h # Generic nodes are not supported by procfs(5) @${REINPLACE_CMD} -e '/mounts/s,/proc,/compat/linux&,' \ ${WRKSRC}/debug/perf/ftrace_impl.cpp .include diff --git a/x11-wm/kwinft/files/patch-main__wayland.cpp b/x11-wm/kwinft/files/patch-main__wayland.cpp new file mode 100644 index 000000000000..df6a92432f05 --- /dev/null +++ b/x11-wm/kwinft/files/patch-main__wayland.cpp @@ -0,0 +1,36 @@ +- Emulate SCHED_RESET_ON_FORK via pthread_atfork +- Switch to pthread_setschedparam as Linux sched_setscheduler + operates on threads contrary to POSIX + +--- main_wayland.cpp.orig 2023-02-17 14:50:58 UTC ++++ main_wayland.cpp +@@ -58,7 +58,7 @@ along with this program. If not, see + #include + +-#include ++#include + #include + + #include +@@ -122,12 +122,17 @@ void gainRealTime() + namespace { + void gainRealTime() + { +-#if HAVE_SCHED_RESET_ON_FORK + const int minPriority = sched_get_priority_min(SCHED_RR); + sched_param sp; + sp.sched_priority = minPriority; +- sched_setscheduler(0, SCHED_RR | SCHED_RESET_ON_FORK, &sp); +-#endif ++ if (pthread_setschedparam(pthread_self(), SCHED_RR, &sp)) ++ return; ++ ++ pthread_atfork(NULL, NULL, []() { ++ sched_param sp; ++ sp.sched_priority = 0; ++ pthread_setschedparam(pthread_self(), SCHED_OTHER, &sp); ++ }); + } + } + diff --git a/x11-wm/kwinft/pkg-message b/x11-wm/kwinft/pkg-message index 68e3a0e9b0dd..969f9444a619 100644 --- a/x11-wm/kwinft/pkg-message +++ b/x11-wm/kwinft/pkg-message @@ -1,41 +1,48 @@ [ { type: install message: <~/.xinitrc $ startx Nested under Wayland as Wayland window manager: $ kwin_wayland Nested under Wayland as X11 window manager: $ Xwayland :8 & $ DISPLAY=:8 kwin_x11 Nested under X11 as Wayland window manager: $ cage kwin_wayland Nested under X11 as X11 window manager: $ Xephyr :8 & $ DISPLAY=:8 kwin_x11 Replace KWin in Plasma Desktop: $ pkg set -n plasma5-kwin:kwinft $ pkg set -o x11-wm/plasma5-kwin:x11-wm/kwinft $ pkg upgrade -f kwinft $ pkg lock kwinft + +Improve Wayland responsiveness under high load: + + $ sysrc kld_list+=mac_priority + $ service kld restart + $ pw groupmod realtime -m + $ exit # log out to refresh group permissions EOM } ]