Commit fde7d449 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

tabletmodemanager: move global to Application

parent 49d80162
......@@ -25,6 +25,7 @@
#endif
#include "session.h"
#include "sm.h"
#include "tabletmodemanager.h"
#include "utils/xcbutils.h"
#include "wayland/surface_interface.h"
#include "workspace.h"
......@@ -278,6 +279,11 @@ void Application::createInputMethod()
m_inputMethod = std::make_unique<InputMethod>();
}
void Application::createTabletModeManager()
{
m_tabletModeManager = std::make_unique<TabletModeManager>();
}
void Application::installNativeX11EventFilter()
{
installNativeEventFilter(m_eventFilter.get());
......
......@@ -34,6 +34,7 @@ class PluginManager;
class InputMethod;
class ColorManager;
class ScreenLockerWatcher;
class TabletModeManager;
class XcbEventFilter : public QAbstractNativeEventFilter
{
......@@ -261,6 +262,7 @@ protected:
void createPlugins();
void createColorManager();
void createInputMethod();
void createTabletModeManager();
void destroyInput();
void destroyWorkspace();
void destroyCompositor();
......@@ -299,6 +301,7 @@ private:
std::unique_ptr<PluginManager> m_pluginManager;
std::unique_ptr<InputMethod> m_inputMethod;
std::unique_ptr<ColorManager> m_colorManager;
std::unique_ptr<TabletModeManager> m_tabletModeManager;
#if KWIN_BUILD_SCREENLOCKER
std::unique_ptr<ScreenLockerWatcher> m_screenLockerWatcher;
#endif
......
......@@ -151,7 +151,7 @@ void ApplicationWayland::performStartup()
createInput();
createInputMethod();
TabletModeManager::create(this);
createTabletModeManager();
WaylandCompositor::create();
......
......@@ -259,7 +259,7 @@ void ApplicationX11::performStartup()
createAtoms();
TabletModeManager::create(this);
createTabletModeManager();
}
bool ApplicationX11::notify(QObject *o, QEvent *e)
......
......@@ -21,8 +21,6 @@
namespace KWin
{
KWIN_SINGLETON_FACTORY_VARIABLE(TabletModeManager, s_manager)
static bool shouldIgnoreDevice(InputDevice *device)
{
if (qobject_cast<FakeInputDevice*>(device)) {
......@@ -111,8 +109,7 @@ private:
TabletModeManager *const m_parent;
};
TabletModeManager::TabletModeManager(QObject *parent)
: QObject(parent)
TabletModeManager::TabletModeManager()
{
if (waylandServer()) {
if (input()->hasTabletModeSwitch()) {
......
......@@ -32,6 +32,7 @@ public:
On
};
explicit TabletModeManager();
~TabletModeManager() override = default;
void setTabletModeAvailable(bool detecting);
......@@ -56,7 +57,6 @@ private:
bool m_isTabletMode = false;
bool m_detecting = false;
ConfiguredMode m_configuredMode = ConfiguredMode::Auto;
KWIN_SINGLETON_VARIABLE(TabletModeManager, s_manager)
};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment