From 00379da3d316a8e3dc4cfb9a1f2afe962d2a7485 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 3 Jun 2022 14:00:54 +0300 Subject: [PATCH] Ignore fake input devices when detecting tablet mode Otherwise launching firefox, which in turn leads to launching of xdg-desktop-portal-kde, disables auto-rotation. --- src/backends/fakeinput/fakeinputdevice.h | 2 +- src/tabletmodemanager.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backends/fakeinput/fakeinputdevice.h b/src/backends/fakeinput/fakeinputdevice.h index bc7f6886d3..9f7e063921 100644 --- a/src/backends/fakeinput/fakeinputdevice.h +++ b/src/backends/fakeinput/fakeinputdevice.h @@ -16,7 +16,7 @@ class FakeInputDevice; namespace KWin { -class FakeInputDevice : public InputDevice +class KWIN_EXPORT FakeInputDevice : public InputDevice { Q_OBJECT diff --git a/src/tabletmodemanager.cpp b/src/tabletmodemanager.cpp index 4326b1e540..09fb073855 100644 --- a/src/tabletmodemanager.cpp +++ b/src/tabletmodemanager.cpp @@ -8,6 +8,7 @@ #include "tabletmodemanager.h" #include "backends/libinput/device.h" +#include "backends/fakeinput/fakeinputdevice.h" #include "input.h" #include "input_event.h" #include "input_event_spy.h" @@ -24,6 +25,10 @@ KWIN_SINGLETON_FACTORY_VARIABLE(TabletModeManager, s_manager) static bool shouldIgnoreDevice(InputDevice *device) { + if (qobject_cast(device)) { + return true; + } + auto libinput_device = qobject_cast(device); if (!libinput_device) { return false;