summaryrefslogtreecommitdiff
path: root/src/protocols/core
diff options
context:
space:
mode:
authoroutfoxxed <outfoxxed@outfoxxed.me>2025-07-08 09:56:40 -0700
committerGitHub <noreply@github.com>2025-07-08 18:56:40 +0200
commit78e9eddfb6bfbc6b103fc60c9831b23ef252886b (patch)
tree4daf06580d89dec717a282c4ec8729285241c8e8 /src/protocols/core
parent2f34ef141b0728857d2a6f777c608dfe4c207733 (diff)
core: use new typed signals from hu (#10853)
Diffstat (limited to 'src/protocols/core')
-rw-r--r--src/protocols/core/Compositor.hpp14
-rw-r--r--src/protocols/core/DataDevice.cpp8
-rw-r--r--src/protocols/core/Output.cpp2
-rw-r--r--src/protocols/core/Output.hpp2
-rw-r--r--src/protocols/core/Seat.cpp6
-rw-r--r--src/protocols/core/Seat.hpp4
-rw-r--r--src/protocols/core/Shm.cpp2
-rw-r--r--src/protocols/core/Subcompositor.cpp2
-rw-r--r--src/protocols/core/Subcompositor.hpp2
9 files changed, 21 insertions, 21 deletions
diff --git a/src/protocols/core/Compositor.hpp b/src/protocols/core/Compositor.hpp
index 90fac35d..26b5a27b 100644
--- a/src/protocols/core/Compositor.hpp
+++ b/src/protocols/core/Compositor.hpp
@@ -80,12 +80,12 @@ class CWLSurfaceResource {
void resetRole();
struct {
- CSignal precommit; // before commit
- CSignal commit; // after commit
- CSignal map;
- CSignal unmap;
- CSignal newSubsurface;
- CSignal destroy;
+ CSignalT<> precommit; // before commit
+ CSignalT<> commit; // after commit
+ CSignalT<> map;
+ CSignalT<> unmap;
+ CSignalT<SP<CWLSubsurfaceResource>> newSubsurface;
+ CSignalT<> destroy;
} m_events;
SSurfaceState m_current;
@@ -146,7 +146,7 @@ class CWLCompositorProtocol : public IWaylandProtocol {
void forEachSurface(std::function<void(SP<CWLSurfaceResource>)> fn);
struct {
- CSignal newSurface; // SP<CWLSurfaceResource>
+ CSignalT<SP<CWLSurfaceResource>> newSurface;
} m_events;
private:
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index 730113f1..4435e4c7 100644
--- a/src/protocols/core/DataDevice.cpp
+++ b/src/protocols/core/DataDevice.cpp
@@ -385,8 +385,8 @@ bool CWLDataDeviceManagerResource::good() {
CWLDataDeviceProtocol::CWLDataDeviceProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
g_pEventLoopManager->doLater([this]() {
- m_listeners.onKeyboardFocusChange = g_pSeatManager->m_events.keyboardFocusChange.registerListener([this](std::any d) { onKeyboardFocus(); });
- m_listeners.onDndPointerFocusChange = g_pSeatManager->m_events.dndPointerFocusChange.registerListener([this](std::any d) { onDndPointerFocus(); });
+ m_listeners.onKeyboardFocusChange = g_pSeatManager->m_events.keyboardFocusChange.listen([this] { onKeyboardFocus(); });
+ m_listeners.onDndPointerFocusChange = g_pSeatManager->m_events.dndPointerFocusChange.listen([this] { onDndPointerFocus(); });
});
}
@@ -564,8 +564,8 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
m_dnd.originSurface = origin;
m_dnd.dndSurface = dragSurface;
if (dragSurface) {
- m_dnd.dndSurfaceDestroy = dragSurface->m_events.destroy.registerListener([this](std::any d) { abortDrag(); });
- m_dnd.dndSurfaceCommit = dragSurface->m_events.commit.registerListener([this](std::any d) {
+ m_dnd.dndSurfaceDestroy = dragSurface->m_events.destroy.listen([this] { abortDrag(); });
+ m_dnd.dndSurfaceCommit = dragSurface->m_events.commit.listen([this] {
if (m_dnd.dndSurface->m_current.texture && !m_dnd.dndSurface->m_mapped) {
m_dnd.dndSurface->map();
return;
diff --git a/src/protocols/core/Output.cpp b/src/protocols/core/Output.cpp
index a9d75972..8ebf87eb 100644
--- a/src/protocols/core/Output.cpp
+++ b/src/protocols/core/Output.cpp
@@ -86,7 +86,7 @@ void CWLOutputResource::updateState() {
CWLOutputProtocol::CWLOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name, PHLMONITOR pMonitor) :
IWaylandProtocol(iface, ver, name), m_monitor(pMonitor), m_name(pMonitor->m_name) {
- m_listeners.modeChanged = m_monitor->m_events.modeChanged.registerListener([this](std::any d) {
+ m_listeners.modeChanged = m_monitor->m_events.modeChanged.listen([this] {
for (auto const& o : m_outputs) {
o->updateState();
}
diff --git a/src/protocols/core/Output.hpp b/src/protocols/core/Output.hpp
index 50deccd3..d0c6fb13 100644
--- a/src/protocols/core/Output.hpp
+++ b/src/protocols/core/Output.hpp
@@ -47,7 +47,7 @@ class CWLOutputProtocol : public IWaylandProtocol {
bool isDefunct(); // true if above was called
struct {
- CSignal outputBound;
+ CSignalT<SP<CWLOutputResource>> outputBound;
} m_events;
private:
diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp
index c341f95a..53123abe 100644
--- a/src/protocols/core/Seat.cpp
+++ b/src/protocols/core/Seat.cpp
@@ -32,7 +32,7 @@ void CWLTouchResource::sendDown(SP<CWLSurfaceResource> surface, uint32_t timeMs,
ASSERT(surface->client() == m_owner->client());
m_currentSurface = surface;
- m_listeners.destroySurface = surface->m_events.destroy.registerListener([this, timeMs, id](std::any d) { sendUp(timeMs + 10 /* hack */, id); });
+ m_listeners.destroySurface = surface->m_events.destroy.listen([this, timeMs, id] { sendUp(timeMs + 10 /* hack */, id); });
m_resource->sendDown(g_pSeatManager->nextSerial(m_owner.lock()), timeMs, surface->getResource().get(), id, wl_fixed_from_double(local.x), wl_fixed_from_double(local.y));
@@ -160,7 +160,7 @@ void CWLPointerResource::sendEnter(SP<CWLSurfaceResource> surface, const Vector2
ASSERT(surface->client() == m_owner->client());
m_currentSurface = surface;
- m_listeners.destroySurface = surface->m_events.destroy.registerListener([this](std::any d) { sendLeave(); });
+ m_listeners.destroySurface = surface->m_events.destroy.listen([this] { sendLeave(); });
m_resource->sendEnter(g_pSeatManager->nextSerial(m_owner.lock()), surface->getResource().get(), wl_fixed_from_double(local.x), wl_fixed_from_double(local.y));
}
@@ -349,7 +349,7 @@ void CWLKeyboardResource::sendEnter(SP<CWLSurfaceResource> surface) {
ASSERT(surface->client() == m_owner->client());
m_currentSurface = surface;
- m_listeners.destroySurface = surface->m_events.destroy.registerListener([this](std::any d) { sendLeave(); });
+ m_listeners.destroySurface = surface->m_events.destroy.listen([this] { sendLeave(); });
wl_array arr;
wl_array_init(&arr);
diff --git a/src/protocols/core/Seat.hpp b/src/protocols/core/Seat.hpp
index 35839385..0c14e52a 100644
--- a/src/protocols/core/Seat.hpp
+++ b/src/protocols/core/Seat.hpp
@@ -142,7 +142,7 @@ class CWLSeatResource {
WP<CWLSeatResource> m_self;
struct {
- CSignal destroy;
+ CSignalT<> destroy;
} m_events;
private:
@@ -157,7 +157,7 @@ class CWLSeatProtocol : public IWaylandProtocol {
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
struct {
- CSignal newSeatResource; // SP<CWLSeatResource>
+ CSignalT<SP<CWLSeatResource>> newSeatResource;
} m_events;
private:
diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp
index 8d610fe0..d73525a6 100644
--- a/src/protocols/core/Shm.cpp
+++ b/src/protocols/core/Shm.cpp
@@ -24,7 +24,7 @@ CWLSHMBuffer::CWLSHMBuffer(SP<CWLSHMPoolResource> pool_, uint32_t id, int32_t of
m_resource = CWLBufferResource::create(makeShared<CWlBuffer>(pool_->m_resource->client(), 1, id));
- m_listeners.bufferResourceDestroy = events.destroy.registerListener([this](std::any d) {
+ m_listeners.bufferResourceDestroy = events.destroy.listen([this] {
m_listeners.bufferResourceDestroy.reset();
PROTO::shm->destroyResource(this);
});
diff --git a/src/protocols/core/Subcompositor.cpp b/src/protocols/core/Subcompositor.cpp
index 71058d25..d18d9fc6 100644
--- a/src/protocols/core/Subcompositor.cpp
+++ b/src/protocols/core/Subcompositor.cpp
@@ -71,7 +71,7 @@ CWLSubsurfaceResource::CWLSubsurfaceResource(SP<CWlSubsurface> resource_, SP<CWL
}
});
- m_listeners.commitSurface = m_surface->m_events.commit.registerListener([this](std::any d) {
+ m_listeners.commitSurface = m_surface->m_events.commit.listen([this] {
if (m_surface->m_current.texture && !m_surface->m_mapped) {
m_surface->map();
m_surface->m_events.map.emit();
diff --git a/src/protocols/core/Subcompositor.hpp b/src/protocols/core/Subcompositor.hpp
index cf7913ec..45b84eba 100644
--- a/src/protocols/core/Subcompositor.hpp
+++ b/src/protocols/core/Subcompositor.hpp
@@ -48,7 +48,7 @@ class CWLSubsurfaceResource {
int m_zIndex = 1; // by default, it's above
struct {
- CSignal destroy;
+ CSignalT<> destroy;
} m_events;
private: