summaryrefslogtreecommitdiff
path: root/src/managers/CursorManager.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-06-19 16:20:06 +0200
committerVaxry <vaxry@vaxry.net>2024-06-19 16:20:15 +0200
commitfb15b7aa2a9bba0f0693f84d0c65d386942583f8 (patch)
treed4403944b5d6a3e03d2262f03a7d0b3ed6ffae24 /src/managers/CursorManager.cpp
parent6e5804b53de753f24953d9d647940df66bc68f6d (diff)
core: Move to hyprutils for Math
Moves CRegion, CBox and Vector2D over to hyprutils. Requires hyprutils>=0.1.4
Diffstat (limited to 'src/managers/CursorManager.cpp')
-rw-r--r--src/managers/CursorManager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/managers/CursorManager.cpp b/src/managers/CursorManager.cpp
index 4430d0f4..daa4f4be 100644
--- a/src/managers/CursorManager.cpp
+++ b/src/managers/CursorManager.cpp
@@ -149,9 +149,10 @@ void CCursorManager::setXCursor(const std::string& name) {
auto image = xcursor->images[0];
- m_vCursorBuffers.emplace_back(std::make_unique<CCursorBuffer>(image->buffer, Vector2D{image->width, image->height}, Vector2D{image->hotspot_x, image->hotspot_y}));
+ m_vCursorBuffers.emplace_back(
+ std::make_unique<CCursorBuffer>(image->buffer, Vector2D{(int)image->width, (int)image->height}, Vector2D{(double)image->hotspot_x, (double)image->hotspot_y}));
- g_pPointerManager->setCursorBuffer(getCursorBuffer(), Vector2D{image->hotspot_x, image->hotspot_y} / scale, scale);
+ g_pPointerManager->setCursorBuffer(getCursorBuffer(), Vector2D{(double)image->hotspot_x, (double)image->hotspot_y} / scale, scale);
if (m_vCursorBuffers.size() > 1)
wlr_buffer_drop(&m_vCursorBuffers.front()->wlrBuffer.base);
@@ -256,8 +257,8 @@ void CCursorManager::setXWaylandCursor() {
g_pXWayland->setCursor(cairo_image_surface_get_data(CURSOR.surface), cairo_image_surface_get_stride(CURSOR.surface), {CURSOR.size, CURSOR.size},
{CURSOR.hotspotX, CURSOR.hotspotY});
} else if (const auto XCURSOR = wlr_xcursor_manager_get_xcursor(m_pWLRXCursorMgr, "left_ptr", 1); XCURSOR) {
- g_pXWayland->setCursor(XCURSOR->images[0]->buffer, XCURSOR->images[0]->width * 4, {XCURSOR->images[0]->width, XCURSOR->images[0]->height},
- {XCURSOR->images[0]->hotspot_x, XCURSOR->images[0]->hotspot_y});
+ g_pXWayland->setCursor(XCURSOR->images[0]->buffer, XCURSOR->images[0]->width * 4, {(int)XCURSOR->images[0]->width, (int)XCURSOR->images[0]->height},
+ {(double)XCURSOR->images[0]->hotspot_x, (double)XCURSOR->images[0]->hotspot_y});
} else
Debug::log(ERR, "CursorManager: no valid cursor for xwayland");
}