Date: Mon, 3 May 2021 18:19:45 GMT From: Adriaan de Groot <adridg@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 2a92ce401f52 - main - KDE Plasma Wayland: improve Wayland experience Message-ID: <202105031819.143IJjlc075216@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by adridg: URL: https://cgit.FreeBSD.org/ports/commit/?id=2a92ce401f52d3744457b7782cd0fa4a14a66ae2 commit 2a92ce401f52d3744457b7782cd0fa4a14a66ae2 Author: Adriaan de Groot <adridg@FreeBSD.org> AuthorDate: 2021-05-03 18:17:12 +0000 Commit: Adriaan de Groot <adridg@FreeBSD.org> CommitDate: 2021-05-03 18:19:43 +0000 KDE Plasma Wayland: improve Wayland experience - Backport an upstream fix for focus-follows-mouse (focus-changing by moving the mouse slowwwwwly didn't work), thanks upstream. - Simplify startplasma-wayland.sh script down to little more than documentation comments and ck-launch dbus-launch, thanks jbeich@ --- x11-wm/plasma5-kwin/Makefile | 2 +- ...ch-git-425170b7814c1ff27b165982b93d78422621bddb | 83 ++++++++++++++++++++++ x11/plasma5-plasma-workspace/Makefile | 2 +- .../files/startplasma-wayland.sh | 39 +++++----- 4 files changed, 107 insertions(+), 19 deletions(-) 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,6 +1,6 @@ PORTNAME= kwin DISTVERSION= ${KDE_PLASMA_VERSION} -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= x11-wm kde kde-plasma MAINTAINER= kde@FreeBSD.org 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 <vlad.zahorodnii@kde.org> +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<AbstractClient*>(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,6 +1,6 @@ PORTNAME= plasma-workspace DISTVERSION= ${KDE_PLASMA_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11 kde kde-plasma MAINTAINER= kde@FreeBSD.org 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,16 +1,21 @@ #! /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 @@ -18,27 +23,27 @@ export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 ### 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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105031819.143IJjlc075216>