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.
This commit is contained in:
Alexander Volkov 2022-06-03 14:00:54 +03:00 committed by Xaver Hugl
parent 3d0beae828
commit 00379da3d3
2 changed files with 6 additions and 1 deletions

View file

@ -16,7 +16,7 @@ class FakeInputDevice;
namespace KWin
{
class FakeInputDevice : public InputDevice
class KWIN_EXPORT FakeInputDevice : public InputDevice
{
Q_OBJECT

View file

@ -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<FakeInputDevice*>(device)) {
return true;
}
auto libinput_device = qobject_cast<LibInput::Device *>(device);
if (!libinput_device) {
return false;