From 9421bc6b32b9aabe57e88541f949575169eb818e Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:29:54 +0200 Subject: add resource version func --- src/protocols/WaylandProtocol.cpp | 4 ++++ src/protocols/WaylandProtocol.hpp | 1 + src/protocols/XDGOutput.cpp | 2 +- subprojects/wlroots | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/protocols/WaylandProtocol.cpp b/src/protocols/WaylandProtocol.cpp index 94f48756..b5acffea 100644 --- a/src/protocols/WaylandProtocol.cpp +++ b/src/protocols/WaylandProtocol.cpp @@ -30,6 +30,10 @@ wl_resource* CWaylandResource::resource() { return m_pWLResource; } +uint32_t CWaylandResource::version() { + return wl_resource_get_version(m_pWLResource); +} + void CWaylandResource::setImplementation(const void* impl, void* data, wl_resource_destroy_func_t df) { RASSERT(!m_bImplementationSet, "Wayland Resource %lx already has an implementation, cannot re-set!", m_pWLResource); diff --git a/src/protocols/WaylandProtocol.hpp b/src/protocols/WaylandProtocol.hpp index aa62c48a..04a58387 100644 --- a/src/protocols/WaylandProtocol.hpp +++ b/src/protocols/WaylandProtocol.hpp @@ -9,6 +9,7 @@ class CWaylandResource { bool good(); wl_resource* resource(); + uint32_t version(); void setImplementation(const void* impl, void* data, wl_resource_destroy_func_t df); diff --git a/src/protocols/XDGOutput.cpp b/src/protocols/XDGOutput.cpp index 372f4af6..ab0820e0 100644 --- a/src/protocols/XDGOutput.cpp +++ b/src/protocols/XDGOutput.cpp @@ -90,7 +90,7 @@ void CXDGOutputProtocol::onManagerGetXDGOutput(wl_client* client, wl_resource* r } pXDGOutput->resource->setImplementation(&OUTPUT_IMPL, this, destroyOutputResourceOnly); - const auto XDGVER = wl_resource_get_version(pXDGOutput->resource->resource()); + const auto XDGVER = pXDGOutput->resource->version(); if (XDGVER >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) zxdg_output_v1_send_name(pXDGOutput->resource->resource(), PMONITOR->szName.c_str()); diff --git a/subprojects/wlroots b/subprojects/wlroots index 7e7633ab..7791ffe0 160000 --- a/subprojects/wlroots +++ b/subprojects/wlroots @@ -1 +1 @@ -Subproject commit 7e7633abf09b362d0bad9e3fc650fd692369291d +Subproject commit 7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e -- cgit v1.2.3