mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
ifdef mouse wayland impl
This commit is contained in:
parent
5c8992bafc
commit
bab0e7b65f
@ -4,19 +4,21 @@
|
|||||||
using namespace WallpaperEngine::Input;
|
using namespace WallpaperEngine::Input;
|
||||||
|
|
||||||
CMouseInput::CMouseInput (GLFWwindow* window) : position (), m_mousePosition (), m_window (window) {}
|
CMouseInput::CMouseInput (GLFWwindow* window) : position (), m_mousePosition (), m_window (window) {}
|
||||||
|
#ifdef ENABLE_WAYLAND
|
||||||
CMouseInput::CMouseInput(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* driver) {
|
CMouseInput::CMouseInput(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* driver) {
|
||||||
waylandDriver = driver;
|
waylandDriver = driver;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CMouseInput::update ()
|
void CMouseInput::update ()
|
||||||
{
|
{
|
||||||
if (!m_window) {
|
if (!m_window) {
|
||||||
|
#ifdef ENABLE_WAYLAND
|
||||||
if (!waylandDriver || !waylandDriver->lastLSInFocus)
|
if (!waylandDriver || !waylandDriver->lastLSInFocus)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->position = waylandDriver->lastLSInFocus->mousePos;
|
this->position = waylandDriver->lastLSInFocus->mousePos;
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef ENABLE_WAYLAND
|
||||||
#include "../Render/Drivers/CWaylandOpenGLDriver.h"
|
#include "../Render/Drivers/CWaylandOpenGLDriver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <glm/vec2.hpp>
|
#include <glm/vec2.hpp>
|
||||||
#include "GLFW/glfw3.h"
|
#include "GLFW/glfw3.h"
|
||||||
@ -15,9 +17,9 @@ namespace WallpaperEngine::Input
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit CMouseInput(GLFWwindow* window);
|
explicit CMouseInput(GLFWwindow* window);
|
||||||
|
#ifdef ENABLE_WAYLAND
|
||||||
explicit CMouseInput(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* driver);
|
explicit CMouseInput(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* driver);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes current mouse position and updates it
|
* Takes current mouse position and updates it
|
||||||
@ -40,10 +42,12 @@ namespace WallpaperEngine::Input
|
|||||||
*/
|
*/
|
||||||
glm::dvec2 m_mousePosition;
|
glm::dvec2 m_mousePosition;
|
||||||
|
|
||||||
|
#ifdef ENABLE_WAYLAND
|
||||||
/**
|
/**
|
||||||
* Wayland: Driver
|
* Wayland: Driver
|
||||||
*/
|
*/
|
||||||
WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* waylandDriver = nullptr;
|
WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver* waylandDriver = nullptr;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user