plugins/shakecursor: Ignore pointer motion events when the pointer is constrained

The main motivation is to prevent the shake cursor from triggering in
video games. It's not a bullet-proof solution though.
This commit is contained in:
Vlad Zahorodnii 2024-01-26 18:08:30 +02:00
parent 1eb95982dc
commit aaa35d455c

View file

@ -13,6 +13,7 @@
#include "opengl/gltexture.h"
#include "opengl/glutils.h"
#include "plugins/shakecursor/shakecursorconfig.h"
#include "pointer_input.h"
namespace KWin
{
@ -76,6 +77,10 @@ void ShakeCursorEffect::pointerEvent(MouseEvent *event)
return;
}
if (input()->pointer()->isConstrained()) {
return;
}
if (const auto shakeFactor = m_shakeDetector.update(event)) {
update(Transaction{
.position = m_cursor->pos(),