aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/CTMControl.cpp2
-rw-r--r--src/protocols/CTMControl.hpp2
-rw-r--r--src/protocols/DRMLease.cpp6
-rw-r--r--src/protocols/DRMLease.hpp10
-rw-r--r--src/protocols/LinuxDMABUF.cpp20
-rw-r--r--src/protocols/LinuxDMABUF.hpp12
-rw-r--r--src/protocols/OutputManagement.cpp2
-rw-r--r--src/protocols/OutputManagement.hpp2
-rw-r--r--src/protocols/PresentationTime.cpp6
-rw-r--r--src/protocols/PresentationTime.hpp6
-rw-r--r--src/protocols/VirtualPointer.cpp4
-rw-r--r--src/protocols/VirtualPointer.hpp12
-rw-r--r--src/protocols/XDGOutput.cpp2
-rw-r--r--src/protocols/XDGOutput.hpp4
-rw-r--r--src/protocols/core/Compositor.cpp6
-rw-r--r--src/protocols/core/Compositor.hpp8
-rw-r--r--src/protocols/core/Output.cpp4
-rw-r--r--src/protocols/core/Output.hpp8
18 files changed, 57 insertions, 59 deletions
diff --git a/src/protocols/CTMControl.cpp b/src/protocols/CTMControl.cpp
index f2a54c6f..cddad830 100644
--- a/src/protocols/CTMControl.cpp
+++ b/src/protocols/CTMControl.cpp
@@ -81,6 +81,6 @@ void CHyprlandCTMControlProtocol::destroyResource(CHyprlandCTMControlResource* r
std::erase_if(m_vManagers, [&](const auto& other) { return other.get() == res; });
}
-void CHyprlandCTMControlProtocol::setCTM(SP<CMonitor> monitor, const Mat3x3& ctm) {
+void CHyprlandCTMControlProtocol::setCTM(PHLMONITOR monitor, const Mat3x3& ctm) {
monitor->setCTM(ctm);
}
diff --git a/src/protocols/CTMControl.hpp b/src/protocols/CTMControl.hpp
index 08f1b0e8..70bc79bc 100644
--- a/src/protocols/CTMControl.hpp
+++ b/src/protocols/CTMControl.hpp
@@ -31,7 +31,7 @@ class CHyprlandCTMControlProtocol : public IWaylandProtocol {
private:
void destroyResource(CHyprlandCTMControlResource* resource);
- void setCTM(SP<CMonitor> monitor, const Mat3x3& ctm);
+ void setCTM(PHLMONITOR monitor, const Mat3x3& ctm);
//
std::vector<SP<CHyprlandCTMControlResource>> m_vManagers;
diff --git a/src/protocols/DRMLease.cpp b/src/protocols/DRMLease.cpp
index d0114ce7..be5a6985 100644
--- a/src/protocols/DRMLease.cpp
+++ b/src/protocols/DRMLease.cpp
@@ -129,7 +129,7 @@ SP<CDRMLeaseConnectorResource> CDRMLeaseConnectorResource::fromResource(wl_resou
return data ? data->self.lock() : nullptr;
}
-CDRMLeaseConnectorResource::CDRMLeaseConnectorResource(SP<CWpDrmLeaseConnectorV1> resource_, SP<CMonitor> monitor_) : monitor(monitor_), resource(resource_) {
+CDRMLeaseConnectorResource::CDRMLeaseConnectorResource(SP<CWpDrmLeaseConnectorV1> resource_, PHLMONITOR monitor_) : monitor(monitor_), resource(resource_) {
if (!good())
return;
@@ -203,7 +203,7 @@ bool CDRMLeaseDeviceResource::good() {
return resource->resource();
}
-void CDRMLeaseDeviceResource::sendConnector(SP<CMonitor> monitor) {
+void CDRMLeaseDeviceResource::sendConnector(PHLMONITOR monitor) {
if (std::find_if(connectorsSent.begin(), connectorsSent.end(), [monitor](const auto& e) { return e && !e->dead && e->monitor == monitor; }) != connectorsSent.end())
return;
@@ -289,7 +289,7 @@ void CDRMLeaseProtocol::destroyResource(CDRMLeaseResource* resource) {
std::erase_if(m_vLeases, [resource](const auto& e) { return e.get() == resource; });
}
-void CDRMLeaseProtocol::offer(SP<CMonitor> monitor) {
+void CDRMLeaseProtocol::offer(PHLMONITOR monitor) {
std::erase_if(primaryDevice->offeredOutputs, [](const auto& e) { return e.expired(); });
if (std::find(primaryDevice->offeredOutputs.begin(), primaryDevice->offeredOutputs.end(), monitor) != primaryDevice->offeredOutputs.end())
return;
diff --git a/src/protocols/DRMLease.hpp b/src/protocols/DRMLease.hpp
index 3671cfce..37de40e3 100644
--- a/src/protocols/DRMLease.hpp
+++ b/src/protocols/DRMLease.hpp
@@ -56,7 +56,7 @@ class CDRMLeaseRequestResource {
class CDRMLeaseConnectorResource {
public:
- CDRMLeaseConnectorResource(SP<CWpDrmLeaseConnectorV1> resource_, SP<CMonitor> monitor_);
+ CDRMLeaseConnectorResource(SP<CWpDrmLeaseConnectorV1> resource_, PHLMONITOR monitor_);
static SP<CDRMLeaseConnectorResource> fromResource(wl_resource*);
bool good();
@@ -64,7 +64,7 @@ class CDRMLeaseConnectorResource {
WP<CDRMLeaseConnectorResource> self;
WP<CDRMLeaseDeviceResource> parent;
- WP<CMonitor> monitor;
+ PHLMONITORREF monitor;
bool dead = false;
private:
@@ -82,7 +82,7 @@ class CDRMLeaseDeviceResource {
CDRMLeaseDeviceResource(SP<CWpDrmLeaseDeviceV1> resource_);
bool good();
- void sendConnector(SP<CMonitor> monitor);
+ void sendConnector(PHLMONITOR monitor);
std::vector<WP<CDRMLeaseConnectorResource>> connectorsSent;
@@ -102,7 +102,7 @@ class CDRMLeaseDevice {
bool success = false;
SP<Aquamarine::CDRMBackend> backend;
- std::vector<WP<CMonitor>> offeredOutputs;
+ std::vector<PHLMONITORREF> offeredOutputs;
};
class CDRMLeaseProtocol : public IWaylandProtocol {
@@ -111,7 +111,7 @@ class CDRMLeaseProtocol : public IWaylandProtocol {
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
- void offer(SP<CMonitor> monitor);
+ void offer(PHLMONITOR monitor);
private:
void destroyResource(CDRMLeaseDeviceResource* resource);
diff --git a/src/protocols/LinuxDMABUF.cpp b/src/protocols/LinuxDMABUF.cpp
index 8e26c74f..e81d7e01 100644
--- a/src/protocols/LinuxDMABUF.cpp
+++ b/src/protocols/LinuxDMABUF.cpp
@@ -21,7 +21,7 @@ static std::optional<dev_t> devIDFromFD(int fd) {
return stat.st_rdev;
}
-CDMABUFFormatTable::CDMABUFFormatTable(SDMABUFTranche _rendererTranche, std::vector<std::pair<SP<CMonitor>, SDMABUFTranche>> tranches_) :
+CDMABUFFormatTable::CDMABUFFormatTable(SDMABUFTranche _rendererTranche, std::vector<std::pair<PHLMONITORREF, SDMABUFTranche>> tranches_) :
rendererTranche(_rendererTranche), monitorTranches(tranches_) {
std::vector<SDMABUFFormatTableEntry> formatsVec;
@@ -436,7 +436,7 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
.formats = g_pHyprOpenGL->getDRMFormats(),
};
- std::vector<std::pair<SP<CMonitor>, SDMABUFTranche>> tches;
+ std::vector<std::pair<PHLMONITORREF, SDMABUFTranche>> tches;
if (g_pCompositor->m_pAqBackend->hasSession()) {
// this assumes there's only 1 device used for both scanout and rendering
@@ -453,20 +453,18 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
static auto monitorAdded = g_pHookSystem->hookDynamic("monitorAdded", [this](void* self, SCallbackInfo& info, std::any param) {
auto pMonitor = std::any_cast<PHLMONITOR>(param);
- auto mon = pMonitor->self.lock();
auto tranche = SDMABUFTranche{
.device = mainDevice,
.flags = ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT,
- .formats = mon->output->getRenderFormats(),
+ .formats = pMonitor->output->getRenderFormats(),
};
- formatTable->monitorTranches.push_back(std::make_pair<>(mon, tranche));
+ formatTable->monitorTranches.push_back(std::make_pair<>(pMonitor, tranche));
resetFormatTable();
});
static auto monitorRemoved = g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, SCallbackInfo& info, std::any param) {
auto pMonitor = std::any_cast<PHLMONITOR>(param);
- auto mon = pMonitor->self.lock();
- std::erase_if(formatTable->monitorTranches, [mon](std::pair<SP<CMonitor>, SDMABUFTranche> pair) { return pair.first == mon; });
+ std::erase_if(formatTable->monitorTranches, [pMonitor](std::pair<PHLMONITORREF, SDMABUFTranche> pair) { return pair.first == pMonitor; });
resetFormatTable();
});
}
@@ -508,8 +506,8 @@ void CLinuxDMABufV1Protocol::resetFormatTable() {
for (auto const& feedback : m_vFeedbacks) {
feedback->resource->sendFormatTable(newFormatTable->tableFD, newFormatTable->tableSize);
if (feedback->lastFeedbackWasScanout) {
- SP<CMonitor> mon;
- auto HLSurface = CWLSurface::fromResource(feedback->surface);
+ PHLMONITOR mon;
+ auto HLSurface = CWLSurface::fromResource(feedback->surface);
if (auto w = HLSurface->getWindow(); w)
if (auto m = g_pCompositor->getMonitorFromID(w->m_iMonitorID); m)
mon = m->self.lock();
@@ -560,7 +558,7 @@ void CLinuxDMABufV1Protocol::destroyResource(CLinuxDMABuffer* resource) {
std::erase_if(m_vBuffers, [&](const auto& other) { return other.get() == resource; });
}
-void CLinuxDMABufV1Protocol::updateScanoutTranche(SP<CWLSurfaceResource> surface, SP<CMonitor> pMonitor) {
+void CLinuxDMABufV1Protocol::updateScanoutTranche(SP<CWLSurfaceResource> surface, PHLMONITOR pMonitor) {
SP<CLinuxDMABUFFeedbackResource> feedbackResource;
for (auto const& f : m_vFeedbacks) {
if (f->surface != surface)
@@ -582,7 +580,7 @@ void CLinuxDMABufV1Protocol::updateScanoutTranche(SP<CWLSurfaceResource> surface
}
const auto& monitorTranchePair = std::find_if(formatTable->monitorTranches.begin(), formatTable->monitorTranches.end(),
- [pMonitor](std::pair<SP<CMonitor>, SDMABUFTranche> pair) { return pair.first == pMonitor; });
+ [pMonitor](std::pair<PHLMONITORREF, SDMABUFTranche> pair) { return pair.first == pMonitor; });
if (monitorTranchePair == formatTable->monitorTranches.end()) {
LOGM(LOG, "updateScanoutTranche: monitor has no tranche");
diff --git a/src/protocols/LinuxDMABUF.hpp b/src/protocols/LinuxDMABUF.hpp
index 0e25cdc6..e4941a6d 100644
--- a/src/protocols/LinuxDMABUF.hpp
+++ b/src/protocols/LinuxDMABUF.hpp
@@ -48,13 +48,13 @@ struct SDMABUFTranche {
class CDMABUFFormatTable {
public:
- CDMABUFFormatTable(SDMABUFTranche rendererTranche, std::vector<std::pair<SP<CMonitor>, SDMABUFTranche>> tranches);
+ CDMABUFFormatTable(SDMABUFTranche rendererTranche, std::vector<std::pair<PHLMONITORREF, SDMABUFTranche>> tranches);
~CDMABUFFormatTable();
- int tableFD = -1;
- size_t tableSize = 0;
- SDMABUFTranche rendererTranche;
- std::vector<std::pair<SP<CMonitor>, SDMABUFTranche>> monitorTranches;
+ int tableFD = -1;
+ size_t tableSize = 0;
+ SDMABUFTranche rendererTranche;
+ std::vector<std::pair<PHLMONITORREF, SDMABUFTranche>> monitorTranches;
};
class CLinuxDMABBUFParamsResource {
@@ -111,7 +111,7 @@ class CLinuxDMABufV1Protocol : public IWaylandProtocol {
~CLinuxDMABufV1Protocol();
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
- void updateScanoutTranche(SP<CWLSurfaceResource> surface, SP<CMonitor> pMonitor);
+ void updateScanoutTranche(SP<CWLSurfaceResource> surface, PHLMONITOR pMonitor);
private:
void destroyResource(CLinuxDMABUFResource* resource);
diff --git a/src/protocols/OutputManagement.cpp b/src/protocols/OutputManagement.cpp
index 77cedd41..0c6a3348 100644
--- a/src/protocols/OutputManagement.cpp
+++ b/src/protocols/OutputManagement.cpp
@@ -633,7 +633,7 @@ SP<COutputMode> COutputManagementProtocol::modeFromResource(wl_resource* r) {
return nullptr;
}
-SP<SWlrManagerSavedOutputState> COutputManagementProtocol::getOutputStateFor(SP<CMonitor> pMonitor) {
+SP<SWlrManagerSavedOutputState> COutputManagementProtocol::getOutputStateFor(PHLMONITOR pMonitor) {
for (auto const& m : m_vManagers) {
if (!m->monitorStates.contains(pMonitor->szName))
continue;
diff --git a/src/protocols/OutputManagement.hpp b/src/protocols/OutputManagement.hpp
index 6deab017..b9e7ce98 100644
--- a/src/protocols/OutputManagement.hpp
+++ b/src/protocols/OutputManagement.hpp
@@ -153,7 +153,7 @@ class COutputManagementProtocol : public IWaylandProtocol {
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
// doesn't have to return one
- SP<SWlrManagerSavedOutputState> getOutputStateFor(SP<CMonitor> pMonitor);
+ SP<SWlrManagerSavedOutputState> getOutputStateFor(PHLMONITOR pMonitor);
private:
void destroyResource(COutputManager* resource);
diff --git a/src/protocols/PresentationTime.cpp b/src/protocols/PresentationTime.cpp
index b66694bf..411036c3 100644
--- a/src/protocols/PresentationTime.cpp
+++ b/src/protocols/PresentationTime.cpp
@@ -14,7 +14,7 @@ void CQueuedPresentationData::setPresentationType(bool zeroCopy_) {
zeroCopy = zeroCopy_;
}
-void CQueuedPresentationData::attachMonitor(SP<CMonitor> pMonitor_) {
+void CQueuedPresentationData::attachMonitor(PHLMONITOR pMonitor_) {
pMonitor = pMonitor_;
}
@@ -73,7 +73,7 @@ void CPresentationFeedback::sendQueued(SP<CQueuedPresentationData> data, timespe
CPresentationProtocol::CPresentationProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
static auto P = g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, SCallbackInfo& info, std::any param) {
- const auto PMONITOR = std::any_cast<PHLMONITOR>(param);
+ const auto PMONITOR = PHLMONITORREF{std::any_cast<PHLMONITOR>(param)};
std::erase_if(m_vQueue, [PMONITOR](const auto& other) { return !other->surface || other->pMonitor == PMONITOR; });
});
}
@@ -107,7 +107,7 @@ void CPresentationProtocol::onGetFeedback(CWpPresentation* pMgr, wl_resource* su
}
}
-void CPresentationProtocol::onPresented(SP<CMonitor> pMonitor, timespec* when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags) {
+void CPresentationProtocol::onPresented(PHLMONITOR pMonitor, timespec* when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags) {
timespec now;
timespec* presentedAt = when;
if (!presentedAt) {
diff --git a/src/protocols/PresentationTime.hpp b/src/protocols/PresentationTime.hpp
index 421bb838..d9b45448 100644
--- a/src/protocols/PresentationTime.hpp
+++ b/src/protocols/PresentationTime.hpp
@@ -14,7 +14,7 @@ class CQueuedPresentationData {
CQueuedPresentationData(SP<CWLSurfaceResource> surf);
void setPresentationType(bool zeroCopy);
- void attachMonitor(SP<CMonitor> pMonitor);
+ void attachMonitor(PHLMONITOR pMonitor);
void presented();
void discarded();
@@ -24,7 +24,7 @@ class CQueuedPresentationData {
private:
bool wasPresented = false;
bool zeroCopy = false;
- WP<CMonitor> pMonitor;
+ PHLMONITORREF pMonitor;
WP<CWLSurfaceResource> surface;
friend class CPresentationFeedback;
@@ -53,7 +53,7 @@ class CPresentationProtocol : public IWaylandProtocol {
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
- void onPresented(SP<CMonitor> pMonitor, timespec* when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags);
+ void onPresented(PHLMONITOR pMonitor, timespec* when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags);
void queueData(SP<CQueuedPresentationData> data);
private:
diff --git a/src/protocols/VirtualPointer.cpp b/src/protocols/VirtualPointer.cpp
index eb92a640..4c5aa13a 100644
--- a/src/protocols/VirtualPointer.cpp
+++ b/src/protocols/VirtualPointer.cpp
@@ -1,7 +1,7 @@
#include "VirtualPointer.hpp"
#include "core/Output.hpp"
-CVirtualPointerV1Resource::CVirtualPointerV1Resource(SP<CZwlrVirtualPointerV1> resource_, WP<CMonitor> boundOutput_) : boundOutput(boundOutput_), resource(resource_) {
+CVirtualPointerV1Resource::CVirtualPointerV1Resource(SP<CZwlrVirtualPointerV1> resource_, PHLMONITORREF boundOutput_) : boundOutput(boundOutput_), resource(resource_) {
if (!good())
return;
@@ -134,7 +134,7 @@ void CVirtualPointerProtocol::destroyResource(CVirtualPointerV1Resource* pointer
std::erase_if(m_vPointers, [&](const auto& other) { return other.get() == pointer; });
}
-void CVirtualPointerProtocol::onCreatePointer(CZwlrVirtualPointerManagerV1* pMgr, wl_resource* seat, uint32_t id, WP<CMonitor> output) {
+void CVirtualPointerProtocol::onCreatePointer(CZwlrVirtualPointerManagerV1* pMgr, wl_resource* seat, uint32_t id, PHLMONITORREF output) {
const auto RESOURCE = m_vPointers.emplace_back(makeShared<CVirtualPointerV1Resource>(makeShared<CZwlrVirtualPointerV1>(pMgr->client(), pMgr->version(), id), output));
diff --git a/src/protocols/VirtualPointer.hpp b/src/protocols/VirtualPointer.hpp
index 7ee450dc..68fe124e 100644
--- a/src/protocols/VirtualPointer.hpp
+++ b/src/protocols/VirtualPointer.hpp
@@ -12,7 +12,7 @@
class CVirtualPointerV1Resource {
public:
- CVirtualPointerV1Resource(SP<CZwlrVirtualPointerV1> resource_, WP<CMonitor> boundOutput_);
+ CVirtualPointerV1Resource(SP<CZwlrVirtualPointerV1> resource_, PHLMONITORREF boundOutput_);
~CVirtualPointerV1Resource();
struct {
@@ -35,12 +35,12 @@ class CVirtualPointerV1Resource {
CSignal holdEnd;
} events;
- bool good();
- wl_client* client();
+ bool good();
+ wl_client* client();
- std::string name;
+ std::string name;
- WP<CMonitor> boundOutput;
+ PHLMONITORREF boundOutput;
private:
SP<CZwlrVirtualPointerV1> resource;
@@ -63,7 +63,7 @@ class CVirtualPointerProtocol : public IWaylandProtocol {
private:
void onManagerResourceDestroy(wl_resource* res);
void destroyResource(CVirtualPointerV1Resource* pointer);
- void onCreatePointer(CZwlrVirtualPointerManagerV1* pMgr, wl_resource* seat, uint32_t id, WP<CMonitor> output);
+ void onCreatePointer(CZwlrVirtualPointerManagerV1* pMgr, wl_resource* seat, uint32_t id, PHLMONITORREF output);
//
std::vector<UP<CZwlrVirtualPointerManagerV1>> m_vManagers;
diff --git a/src/protocols/XDGOutput.cpp b/src/protocols/XDGOutput.cpp
index 0598e713..deb87829 100644
--- a/src/protocols/XDGOutput.cpp
+++ b/src/protocols/XDGOutput.cpp
@@ -95,7 +95,7 @@ void CXDGOutputProtocol::updateAllOutputs() {
//
-CXDGOutput::CXDGOutput(SP<CZxdgOutputV1> resource_, SP<CMonitor> monitor_) : monitor(monitor_), resource(resource_) {
+CXDGOutput::CXDGOutput(SP<CZxdgOutputV1> resource_, PHLMONITOR monitor_) : monitor(monitor_), resource(resource_) {
if (!resource->resource())
return;
diff --git a/src/protocols/XDGOutput.hpp b/src/protocols/XDGOutput.hpp
index 520f3aaa..6a5be284 100644
--- a/src/protocols/XDGOutput.hpp
+++ b/src/protocols/XDGOutput.hpp
@@ -10,12 +10,12 @@ class CWLOutputProtocol;
class CXDGOutput {
public:
- CXDGOutput(SP<CZxdgOutputV1> resource, SP<CMonitor> monitor_);
+ CXDGOutput(SP<CZxdgOutputV1> resource, PHLMONITOR monitor_);
void sendDetails();
private:
- WP<CMonitor> monitor;
+ PHLMONITORREF monitor;
SP<CZxdgOutputV1> resource;
WP<CWLOutputProtocol> outputProto;
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index 3d4b63c1..9a2e00a9 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -182,7 +182,7 @@ wl_client* CWLSurfaceResource::client() {
return pClient;
}
-void CWLSurfaceResource::enter(SP<CMonitor> monitor) {
+void CWLSurfaceResource::enter(PHLMONITOR monitor) {
if (std::find(enteredOutputs.begin(), enteredOutputs.end(), monitor) != enteredOutputs.end())
return;
@@ -209,7 +209,7 @@ void CWLSurfaceResource::enter(SP<CMonitor> monitor) {
resource->sendEnter(output->getResource().get());
}
-void CWLSurfaceResource::leave(SP<CMonitor> monitor) {
+void CWLSurfaceResource::leave(PHLMONITOR monitor) {
if (std::find(enteredOutputs.begin(), enteredOutputs.end(), monitor) == enteredOutputs.end())
return;
@@ -509,7 +509,7 @@ void CWLSurfaceResource::updateCursorShm() {
memcpy(shmData.data(), pixelData, bufLen);
}
-void CWLSurfaceResource::presentFeedback(timespec* when, SP<CMonitor> pMonitor) {
+void CWLSurfaceResource::presentFeedback(timespec* when, PHLMONITOR pMonitor) {
frame(when);
auto FEEDBACK = makeShared<CQueuedPresentationData>(self.lock());
FEEDBACK->attachMonitor(pMonitor);
diff --git a/src/protocols/core/Compositor.hpp b/src/protocols/core/Compositor.hpp
index b3c067c9..fbffd966 100644
--- a/src/protocols/core/Compositor.hpp
+++ b/src/protocols/core/Compositor.hpp
@@ -60,8 +60,8 @@ class CWLSurfaceResource {
bool good();
wl_client* client();
- void enter(SP<CMonitor> monitor);
- void leave(SP<CMonitor> monitor);
+ void enter(PHLMONITOR monitor);
+ void leave(PHLMONITOR monitor);
void sendPreferredTransform(wl_output_transform t);
void sendPreferredScale(int32_t scale);
void frame(timespec* now);
@@ -115,7 +115,7 @@ class CWLSurfaceResource {
std::vector<SP<CWLCallbackResource>> callbacks;
WP<CWLSurfaceResource> self;
WP<CWLSurface> hlSurface;
- std::vector<WP<CMonitor>> enteredOutputs;
+ std::vector<PHLMONITORREF> enteredOutputs;
bool mapped = false;
std::vector<WP<CWLSubsurfaceResource>> subsurfaces;
SP<ISurfaceRole> role;
@@ -124,7 +124,7 @@ class CWLSurfaceResource {
void breadthfirst(std::function<void(SP<CWLSurfaceResource>, const Vector2D&, void*)> fn, void* data);
CRegion accumulateCurrentBufferDamage();
- void presentFeedback(timespec* when, SP<CMonitor> pMonitor);
+ void presentFeedback(timespec* when, PHLMONITOR pMonitor);
void lockPendingState();
void unlockPendingState();
diff --git a/src/protocols/core/Output.cpp b/src/protocols/core/Output.cpp
index e9f35abc..edeeb584 100644
--- a/src/protocols/core/Output.cpp
+++ b/src/protocols/core/Output.cpp
@@ -3,7 +3,7 @@
#include "../../Compositor.hpp"
#include "../../helpers/Monitor.hpp"
-CWLOutputResource::CWLOutputResource(SP<CWlOutput> resource_, SP<CMonitor> pMonitor) : monitor(pMonitor), resource(resource_) {
+CWLOutputResource::CWLOutputResource(SP<CWlOutput> resource_, PHLMONITOR pMonitor) : monitor(pMonitor), resource(resource_) {
if (!good())
return;
@@ -83,7 +83,7 @@ void CWLOutputResource::updateState() {
resource->sendDone();
}
-CWLOutputProtocol::CWLOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name, SP<CMonitor> pMonitor) :
+CWLOutputProtocol::CWLOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name, PHLMONITOR pMonitor) :
IWaylandProtocol(iface, ver, name), monitor(pMonitor), szName(pMonitor->szName) {
listeners.modeChanged = monitor->events.modeChanged.registerListener([this](std::any d) {
diff --git a/src/protocols/core/Output.hpp b/src/protocols/core/Output.hpp
index 49c32ec1..a4c81d72 100644
--- a/src/protocols/core/Output.hpp
+++ b/src/protocols/core/Output.hpp
@@ -12,7 +12,7 @@ class CWLOutputProtocol;
class CWLOutputResource {
public:
- CWLOutputResource(SP<CWlOutput> resource_, SP<CMonitor> pMonitor);
+ CWLOutputResource(SP<CWlOutput> resource_, PHLMONITOR pMonitor);
static SP<CWLOutputResource> fromResource(wl_resource*);
bool good();
@@ -20,7 +20,7 @@ class CWLOutputResource {
SP<CWlOutput> getResource();
void updateState();
- WP<CMonitor> monitor;
+ PHLMONITORREF monitor;
WP<CWLOutputProtocol> owner;
WP<CWLOutputResource> self;
@@ -33,14 +33,14 @@ class CWLOutputResource {
class CWLOutputProtocol : public IWaylandProtocol {
public:
- CWLOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name, SP<CMonitor> pMonitor);
+ CWLOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name, PHLMONITOR pMonitor);
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
SP<CWLOutputResource> outputResourceFrom(wl_client* client);
void sendDone();
- WP<CMonitor> monitor;
+ PHLMONITORREF monitor;
WP<CWLOutputProtocol> self;
// will mark the protocol for removal, will be removed when no. of bound outputs is 0 (or when overwritten by a new global)