Fix compile failure without XINPUT

Declare and reference m_xinputIntegration only if HAVE_X11_XINPUT is defined and enabled.
This commit is contained in:
Parag W 2022-12-31 11:19:45 +00:00 committed by Vlad Zahorodnii
parent 133315267b
commit 6352173651
2 changed files with 7 additions and 4 deletions

View file

@ -8,8 +8,6 @@
*/ */
#include "x11_standalone_backend.h" #include "x11_standalone_backend.h"
#include <config-kwin.h>
#include "atoms.h" #include "atoms.h"
#include "core/session.h" #include "core/session.h"
#include "x11_standalone_cursor.h" #include "x11_standalone_cursor.h"
@ -177,8 +175,8 @@ std::unique_ptr<Edge> X11StandaloneBackend::createScreenEdge(ScreenEdges *edges)
void X11StandaloneBackend::createPlatformCursor(QObject *parent) void X11StandaloneBackend::createPlatformCursor(QObject *parent)
{ {
auto c = new X11Cursor(parent, m_xinputIntegration != nullptr);
#if HAVE_X11_XINPUT #if HAVE_X11_XINPUT
auto c = new X11Cursor(parent, m_xinputIntegration != nullptr);
if (m_xinputIntegration) { if (m_xinputIntegration) {
m_xinputIntegration->setCursor(c); m_xinputIntegration->setCursor(c);
// we know we have xkb already // we know we have xkb already
@ -186,6 +184,8 @@ void X11StandaloneBackend::createPlatformCursor(QObject *parent)
xkb->setConfig(kwinApp()->kxkbConfig()); xkb->setConfig(kwinApp()->kxkbConfig());
xkb->reconfigure(); xkb->reconfigure();
} }
#else
new X11Cursor(parent, false);
#endif #endif
} }

View file

@ -9,8 +9,9 @@
#pragma once #pragma once
#include "core/outputbackend.h" #include <config-kwin.h>
#include "core/outputbackend.h"
#include <kwin_export.h> #include <kwin_export.h>
#include <QObject> #include <QObject>
@ -82,7 +83,9 @@ private:
void updateRefreshRate(); void updateRefreshRate();
void updateCursor(); void updateCursor();
#if HAVE_X11_XINPUT
std::unique_ptr<XInputIntegration> m_xinputIntegration; std::unique_ptr<XInputIntegration> m_xinputIntegration;
#endif
std::unique_ptr<QTimer> m_updateOutputsTimer; std::unique_ptr<QTimer> m_updateOutputsTimer;
Display *m_x11Display; Display *m_x11Display;
std::unique_ptr<WindowSelector> m_windowSelector; std::unique_ptr<WindowSelector> m_windowSelector;