diff --git a/x11-wm/plasma5-kwin/Makefile b/x11-wm/plasma5-kwin/Makefile index fceab4c12ef4..a60e5dca2c88 100644 --- a/x11-wm/plasma5-kwin/Makefile +++ b/x11-wm/plasma5-kwin/Makefile @@ -1,53 +1,53 @@ PORTNAME= kwin DISTVERSION= ${KDE_PLASMA_VERSION} -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= x11-wm kde kde-plasma MAINTAINER= kde@FreeBSD.org COMMENT= Plasma5 window manager LICENSE= GPLv2 LIB_DEPENDS= libXcursor.so:x11/libXcursor \ libdrm.so:graphics/libdrm \ libepoxy.so:graphics/libepoxy \ libepoll-shim.so:devel/libepoll-shim \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libinput.so:x11/libinput \ libudev.so:devel/libudev-devd \ liblcms2.so:graphics/lcms2 \ libwayland-cursor.so:graphics/wayland \ libxcb-cursor.so:x11/xcb-util-cursor \ libxcb-icccm.so:x11/xcb-util-wm \ libxcb-image.so:x11/xcb-util-image \ 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 \ ${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 USE_GL= egl USE_GNOME= glib20 USE_KDE= activities activities attica auth breeze codecs \ completion config configwidgets coreaddons crash decoration \ globalaccel i18n iconthemes idletime init \ jobwidgets kcmutils kdeclarative kio kscreenlocker \ newstuff notifications package plasma-framework runner service sonnet \ 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 \ buildtools_build qmake_build \ quickcontrols2_run virtualkeyboard_run USE_XORG= ice sm x11 xcb xext xi SHEBANG_FILES= kconf_update/*.py \ kconf_update/*.pl .include diff --git a/x11-wm/plasma5-kwin/files/patch-git-425170b7814c1ff27b165982b93d78422621bddb b/x11-wm/plasma5-kwin/files/patch-git-425170b7814c1ff27b165982b93d78422621bddb new file mode 100644 index 000000000000..7d3a2293fe63 --- /dev/null +++ b/x11-wm/plasma5-kwin/files/patch-git-425170b7814c1ff27b165982b93d78422621bddb @@ -0,0 +1,83 @@ +commit 425170b7814c1ff27b165982b93d78422621bddb (origin/work/wayland-fix-focus-follows-mouse) +Author: Vlad Zahorodnii +Date: Mon May 3 11:24:22 2021 +0300 + + wayland: Fix focus follows mouse policy + + We want to update the input focus only if the pointer is moved. Due to + that, AbstractClient::enterEvent() checks the last seen pointer position + to decide whether the window needs to be focused. + + The issue is that when the pointer moves from a decoration to a surface, + the cached pointer position will be updated to the current pointer + position, and thus the check in AbstractClient::enterEvent() will fail. + + We need to update the cached pointer position only if there is a focused + decoration. + +diff --git src/input.cpp src/input.cpp +index 9377e9334..b1b961e39 100644 +--- input.cpp ++++ input.cpp +@@ -2846,6 +2846,7 @@ void InputDeviceHandler::update() + setAt(toplevel); + + if (focusUpdatesBlocked()) { ++ workspace()->updateFocusMousePosition(position().toPoint()); + return; + } + +@@ -2860,21 +2861,20 @@ void InputDeviceHandler::update() + // went onto or off from decoration, update focus + updateFocus(); + } +- return; +- } +- updateInternalWindow(nullptr); ++ } else { ++ updateInternalWindow(nullptr); + +- if (m_focus.focus != m_at.at) { +- // focus change +- updateDecoration(); +- updateFocus(); +- return; +- } +- // check if switched to/from decoration while staying on the same Toplevel +- if (updateDecoration()) { +- // went onto or off from decoration, update focus +- updateFocus(); ++ if (m_focus.focus != m_at.at) { ++ // focus change ++ updateDecoration(); ++ updateFocus(); ++ } else if (updateDecoration()) { ++ // went onto or off from decoration, update focus ++ updateFocus(); ++ } + } ++ ++ workspace()->updateFocusMousePosition(position().toPoint()); + } + + Toplevel *InputDeviceHandler::at() const +diff --git src/pointer_input.cpp src/pointer_input.cpp +index bf59197d3..a93c2cf55 100644 +--- pointer_input.cpp ++++ pointer_input.cpp +@@ -473,7 +473,6 @@ void PointerInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl + { + disconnect(m_decorationGeometryConnection); + m_decorationGeometryConnection = QMetaObject::Connection(); +- workspace()->updateFocusMousePosition(position().toPoint()); + + if (old) { + // send leave event to old decoration +@@ -524,7 +523,6 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow + + if (AbstractClient *ac = qobject_cast(focusNow)) { + ac->enterEvent(m_pos.toPoint()); +- workspace()->updateFocusMousePosition(m_pos.toPoint()); + } + + if (internalWindow()) { diff --git a/x11/plasma5-plasma-workspace/Makefile b/x11/plasma5-plasma-workspace/Makefile index fbaacd9b9af0..52a6cfb40717 100644 --- a/x11/plasma5-plasma-workspace/Makefile +++ b/x11/plasma5-plasma-workspace/Makefile @@ -1,57 +1,57 @@ PORTNAME= plasma-workspace DISTVERSION= ${KDE_PLASMA_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11 kde kde-plasma MAINTAINER= kde@FreeBSD.org COMMENT= Plasma5 Plasma workspace LIB_DEPENDS= libcln.so:math/cln \ libdbusmenu-qt5.so:devel/libdbusmenu-qt \ libfreetype.so:print/freetype2 \ libfontconfig.so:x11-fonts/fontconfig \ libqalculate.so:math/libqalculate \ libwayland-client.so:graphics/wayland \ libxcb-image.so:x11/xcb-util-image \ libxcb-util.so:x11/xcb-util RUN_DEPENDS= ck-launch-session:sysutils/consolekit2\ iceauth:x11/iceauth \ xsetroot:x11/xsetroot \ xset:x11/xset \ xmessage:x11/xmessage \ ${LOCALBASE}/libdata/pkgconfig/xkeyboard-config.pc:x11/xkeyboard-config \ iso-codes>=0:misc/iso-codes \ ${LOCALBASE}/bin/genv:sysutils/coreutils USES= cmake compiler:c++11-lib cpe desktop-file-utils gettext kde:5 pkgconfig \ qt:5 tar:xz xorg USE_KDE= activities activities-stats activitymanagerd attica archive auth baloo bookmarks \ codecs completion config configwidgets coreaddons crash \ dbusaddons doctools emoticons filemetadata globalaccel \ guiaddons holidays i18n iconthemes idletime init itemmodels \ itemviews jobwidgets js jsembed kcmutils kdeclarative \ kdelibs4support kdesu kdewebkit kio kscreenlocker \ notifications package pty kwin libkscreen libksysguard \ newstuff notifyconfig parts people plasma-framework \ plasma-integration prison runner service solid sonnet \ texteditor textwidgets unitconversion wallet wayland \ widgetsaddons windowsystem xmlgui xmlrpcclient \ breeze_run breeze-icons_run kquickcharts_run oxygen-icons5_run \ kded_run milou_run USE_QT= concurrent core declarative dbus graphicaleffects gui network phonon4 \ printsupport qdbus quickcontrols_run script svg sql \ testlib wayland webkit widgets x11extras xml \ paths_run \ buildtools_build qmake_build USE_XORG= ice sm x11 xau xcb xcomposite xcursor xext xfixes xft xkbfile xrender xtst CMAKE_OFF= BUILD_TESTING # In 5.15 a file was moved from x11/plasma5-plasma-desktop to x11/plasma5-plasma-workspace: CONFLICTS_INSTALL= plasma5-plasma-desktop-5.14.* post-stage: ${INSTALL_SCRIPT} ${FILESDIR}/startplasma-wayland.sh ${STAGEDIR}/${LOCALBASE}/bin/ .include diff --git a/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh b/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh index cfd30dacc18a..b94c59f82efa 100755 --- a/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh +++ b/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh @@ -1,61 +1,66 @@ #! /bin/sh # -# Try to run a Plasma Wayland session; to be invoked from a text console +# Try to run a Plasma Wayland session; to be invoked from a text console. +# This script is far longer than it needs to be, because it documents +# all kinds of settings that you **might** want to set for specific +# use-cases or testing. ### TOOLKIT SETTINGS # -# Tell toolkits to use wayland -export MOZ_ENABLE_WAYLAND=1 -export GDK_BACKEND=wayland -export QT_QPA_PLATFORM=wayland-egl -export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 +# Force toolkits to use wayland. +# - MOZ is for Firefox +# - GDK is for GDK, will crash non-Wayland GDK-users like emacs +# - QPA is for Qt, forces EGL, causes graphics glitches +# export MOZ_ENABLE_WAYLAND=1 +# export GDK_BACKEND=wayland +# export QT_QPA_PLATFORM=wayland-egl -# Possible settings for drivers +### DRIVER SETTINGS # # Some (older) Intel HD iGPU need this: # export LIBVA_DRIVER_NAME=i965 ### XDG SETTINGS # # -if test -z "$XDG_RUNTIME_DIR"; then - export XDG_RUNTIME_DIR=/tmp/`id -u`-runtime-dir - if ! test -d "$XDG_RUNTIME_DIR"; then - mkdir "$XDG_RUNTIME_DIR" - chmod 0700 "$XDG_RUNTIME_DIR" - fi -fi -export XDG_SESSION_TYPE=wayland +# export XDG_SESSION_TYPE=wayland -### KDE / Plasma / Qt settings +### KDE / Plasma / Qt SETTINGS # # # To switch on software rendering: # export KWIN_COMPOSE=Q +# Disable client-side-decorations: +# export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 # To log debug things: # export QT_LOGGING_RULES="kwin_core.debug=true;kwin_libinput.debug=true" # To log to a specific file (recommended if you're using the logging rules # and want to debug startup problems): # LOGFILE=/tmp/plasma-wayland.log -# TODO: check if ck-launch-session is needed +### STARTUP SEQUENCE +# +# Plasma needs a DBus session-bus, and it needs to have access to +# the DRM GPU (e.g. to /dev/dri/card0) which we arrange through +# ConsoleKit2. +# scaffolding="ck-launch-session" if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] ; then scaffolding="$scaffolding dbus-run-session" fi startup_dir=`/usr/bin/dirname "$0"` startup_exe=`/usr/bin/basename "$0" .sh` if [ -z "$LOGFILE" ] ; then { echo "Starting KDE Plasma Wayland from PID $$" echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" echo "scaffolding=$scaffolding" echo "startup=$startup_dir/$startup_exe" } > $LOGFILE exec $scaffolding $startup_dir/$startup_exe 2>&1 | tee -a $LOG else exec $scaffolding $startup_dir/$startup_exe fi