mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 13:22:23 +08:00
minor improvements to pointer handling
This commit is contained in:
parent
ee3f000ab1
commit
997f780f4c
@ -16,5 +16,12 @@ glm::dvec2 CWaylandMouseInput::position() const {
|
|||||||
if (!waylandDriver || !waylandDriver->lastLSInFocus)
|
if (!waylandDriver || !waylandDriver->lastLSInFocus)
|
||||||
return {0, 0};
|
return {0, 0};
|
||||||
|
|
||||||
return waylandDriver->lastLSInFocus->mousePos;
|
for (auto& o : waylandDriver->m_outputs) {
|
||||||
|
if (!o->rendering)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return o->layerSurface.get() == waylandDriver->lastLSInFocus ? o->layerSurface->mousePos : glm::dvec2{-1337, -1337};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {0, 0};
|
||||||
}
|
}
|
@ -46,7 +46,7 @@ static void handlePointerMotion(void* data, struct wl_pointer* wl_pointer, uint3
|
|||||||
if (!PDRIVER->lastLSInFocus)
|
if (!PDRIVER->lastLSInFocus)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PDRIVER->lastLSInFocus->mousePos = {x, y};
|
PDRIVER->lastLSInFocus->mousePos = {x * PDRIVER->lastLSInFocus->output->scale, y * PDRIVER->lastLSInFocus->output->scale};
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handlePointerButton(void* data, struct wl_pointer* wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t button_state) {
|
static void handlePointerButton(void* data, struct wl_pointer* wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t button_state) {
|
||||||
|
Loading…
Reference in New Issue
Block a user