parent
cd20a4a868
commit
f1157a5e58
@ -1,89 +0,0 @@
|
||||
From 073b6efc144d8aabef2eea8f64b84ffdca87b6b5 Mon Sep 17 00:00:00 2001
|
||||
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
Date: Mon, 3 May 2021 11:24:22 +0300
|
||||
Subject: [PATCH] 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.
|
||||
---
|
||||
src/input.cpp | 26 +++++++++++++-------------
|
||||
src/pointer_input.cpp | 2 --
|
||||
2 files changed, 13 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/input.cpp b/src/input.cpp
|
||||
index 9377e9334..b1b961e39 100644
|
||||
--- a/input.cpp
|
||||
+++ b/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 a/src/pointer_input.cpp b/src/pointer_input.cpp
|
||||
index bf59197d3..a93c2cf55 100644
|
||||
--- a/pointer_input.cpp
|
||||
+++ b/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()) {
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,55 +0,0 @@
|
||||
From caaabf84df3aaf96eb0fcccc8c17baefe97826b5 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Grulich <jgrulich@redhat.com>
|
||||
Date: Wed, 5 May 2021 10:01:49 +0200
|
||||
Subject: [PATCH] Screencast: use dma-bufs only when client explicitly asks for
|
||||
it
|
||||
|
||||
---
|
||||
plugins/screencast/pipewirestream.cpp | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugins/screencast/pipewirestream.cpp b/plugins/screencast/pipewirestream.cpp
|
||||
index 8f9ed30e0..1e86f8b81 100644
|
||||
--- a/plugins/screencast/pipewirestream.cpp
|
||||
+++ b/plugins/screencast/pipewirestream.cpp
|
||||
@@ -106,13 +106,16 @@ void PipeWireStream::onStreamParamChanged(void *data, uint32_t id, const struct
|
||||
|
||||
void PipeWireStream::onStreamAddBuffer(void *data, pw_buffer *buffer)
|
||||
{
|
||||
+ QSharedPointer<DmaBufTexture> dmabuf;
|
||||
PipeWireStream *stream = static_cast<PipeWireStream *>(data);
|
||||
struct spa_data *spa_data = buffer->buffer->datas;
|
||||
|
||||
spa_data->mapoffset = 0;
|
||||
spa_data->flags = SPA_DATA_FLAG_READWRITE;
|
||||
|
||||
- QSharedPointer<DmaBufTexture> dmabuf(kwinApp()->platform()->createDmaBufTexture(stream->m_resolution));
|
||||
+ if (spa_data[0].type != SPA_ID_INVALID && spa_data[0].type & (1 << SPA_DATA_DmaBuf))
|
||||
+ dmabuf.reset(kwinApp()->platform()->createDmaBufTexture(stream->m_resolution));
|
||||
+
|
||||
if (dmabuf) {
|
||||
spa_data->type = SPA_DATA_DmaBuf;
|
||||
spa_data->fd = dmabuf->fd();
|
||||
@@ -122,6 +125,11 @@ void PipeWireStream::onStreamAddBuffer(void *data, pw_buffer *buffer)
|
||||
stream->m_dmabufDataForPwBuffer.insert(buffer, dmabuf);
|
||||
#ifdef F_SEAL_SEAL //Disable memfd on systems that don't have it, like BSD < 12
|
||||
} else {
|
||||
+ if (!(spa_data[0].type & (1 << SPA_DATA_MemFd))) {
|
||||
+ qCCritical(KWIN_SCREENCAST) << "memfd: Client doesn't support memfd buffer data type";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
const int bytesPerPixel = stream->m_hasAlpha ? 4 : 3;
|
||||
const int stride = SPA_ROUND_UP_N (stream->m_resolution.width() * bytesPerPixel, 4);
|
||||
spa_data->maxsize = stride * stream->m_resolution.height();
|
||||
@@ -341,7 +349,7 @@ void PipeWireStream::recordFrame(GLTexture *frameTexture, const QRegion &damaged
|
||||
|
||||
const auto size = frameTexture->size();
|
||||
spa_data->chunk->offset = 0;
|
||||
- if (data) {
|
||||
+ if (data || spa_data[0].type == SPA_DATA_MemFd) {
|
||||
const int bpp = data && !m_hasAlpha ? 3 : 4;
|
||||
const uint stride = SPA_ROUND_UP_N (size.width() * bpp, 4);
|
||||
const uint bufferSize = stride * size.height();
|
||||
--
|
||||
GitLab
|
@ -1 +1 @@
|
||||
SHA512 (kwin-5.21.5.tar.xz) = b749892b12b027b306836bbd7b770602bff80c0ce6840db3345585a1215b415fe24fb823bbcb399f76999232f100bb2e1898d460160e1a762ea10fd24d6cf63c
|
||||
SHA512 (kwin-5.21.90.tar.xz) = de9004260e96c90bb4f4253c6c10f79acee9b7676fca2f61140232c26c3bb842ca56776ecebc734d37000625fccfc39d14d51fab203e7db493361e43272c94e8
|
||||
|
Loading…
Reference in new issue