internal: Move CMonitor to SP (#8178)

* move monitors to sp

* XD
This commit is contained in:
Vaxry
2024-10-19 23:03:29 +01:00
committed by GitHub
parent ce3ba798df
commit f044e4c951
66 changed files with 424 additions and 446 deletions

View File

@@ -44,7 +44,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
if (PWINDOW->m_pWorkspace != monitor->activeWorkspace) {
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, monitor->activeWorkspace);
g_pCompositor->setActiveMonitor(monitor.get());
g_pCompositor->setActiveMonitor(monitor);
}
}
}
@@ -116,7 +116,7 @@ wl_resource* CForeignToplevelHandleWlr::res() {
return resource->resource();
}
void CForeignToplevelHandleWlr::sendMonitor(CMonitor* pMonitor) {
void CForeignToplevelHandleWlr::sendMonitor(PHLMONITOR pMonitor) {
if (lastMonitorID == pMonitor->ID)
return;

View File

@@ -22,7 +22,7 @@ class CForeignToplevelHandleWlr {
bool closed = false;
MONITORID lastMonitorID = MONITOR_INVALID;
void sendMonitor(CMonitor* pMonitor);
void sendMonitor(PHLMONITOR pMonitor);
void sendState();
friend class CForeignToplevelWlrManager;

View File

@@ -143,11 +143,11 @@ void CGammaControl::applyToMonitor() {
pMonitor->output->state->setGammaLut({});
}
g_pHyprRenderer->damageMonitor(pMonitor.get());
g_pHyprRenderer->damageMonitor(pMonitor.lock());
}
CMonitor* CGammaControl::getMonitor() {
return pMonitor ? pMonitor.get() : nullptr;
PHLMONITOR CGammaControl::getMonitor() {
return pMonitor ? pMonitor.lock() : nullptr;
}
void CGammaControl::onMonitorDestroy() {
@@ -186,7 +186,7 @@ void CGammaControlProtocol::onGetGammaControl(CZwlrGammaControlManagerV1* pMgr,
}
}
void CGammaControlProtocol::applyGammaToState(CMonitor* pMonitor) {
void CGammaControlProtocol::applyGammaToState(PHLMONITOR pMonitor) {
for (auto const& g : m_vGammaControllers) {
if (g->getMonitor() != pMonitor)
continue;

View File

@@ -14,13 +14,13 @@ class CGammaControl {
CGammaControl(SP<CZwlrGammaControlV1> resource_, wl_resource* output);
~CGammaControl();
bool good();
void applyToMonitor();
CMonitor* getMonitor();
bool good();
void applyToMonitor();
PHLMONITOR getMonitor();
private:
SP<CZwlrGammaControlV1> resource;
WP<CMonitor> pMonitor;
PHLMONITORREF pMonitor;
size_t gammaSize = 0;
bool gammaTableSet = false;
std::vector<uint16_t> gammaTable; // [r,g,b]+
@@ -39,7 +39,7 @@ class CGammaControlProtocol : public IWaylandProtocol {
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
void applyGammaToState(CMonitor* pMonitor);
void applyGammaToState(PHLMONITOR pMonitor);
private:
void onManagerResourceDestroy(wl_resource* res);

View File

@@ -14,8 +14,8 @@ void CLayerShellResource::SState::reset() {
margin = {0, 0, 0, 0};
}
CLayerShellResource::CLayerShellResource(SP<CZwlrLayerSurfaceV1> resource_, SP<CWLSurfaceResource> surf_, std::string namespace_, CMonitor* pMonitor, zwlrLayerShellV1Layer layer) :
layerNamespace(namespace_), surface(surf_), resource(resource_) {
CLayerShellResource::CLayerShellResource(SP<CZwlrLayerSurfaceV1> resource_, SP<CWLSurfaceResource> surf_, std::string namespace_, PHLMONITOR pMonitor,
zwlrLayerShellV1Layer layer) : layerNamespace(namespace_), surface(surf_), resource(resource_) {
if (!good())
return;
@@ -218,7 +218,7 @@ void CLayerShellProtocol::destroyResource(CLayerShellResource* surf) {
void CLayerShellProtocol::onGetLayerSurface(CZwlrLayerShellV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* output, zwlrLayerShellV1Layer layer, std::string namespace_) {
const auto CLIENT = pMgr->client();
const auto PMONITOR = output ? CWLOutputResource::fromResource(output)->monitor.get() : nullptr;
const auto PMONITOR = output ? CWLOutputResource::fromResource(output)->monitor.lock() : nullptr;
auto SURF = CWLSurfaceResource::fromResource(surface);
if (!SURF) {

View File

@@ -26,7 +26,7 @@ class CLayerShellRole : public ISurfaceRole {
};
class CLayerShellResource {
public:
CLayerShellResource(SP<CZwlrLayerSurfaceV1> resource_, SP<CWLSurfaceResource> surf_, std::string namespace_, CMonitor* pMonitor, zwlrLayerShellV1Layer layer);
CLayerShellResource(SP<CZwlrLayerSurfaceV1> resource_, SP<CWLSurfaceResource> surf_, std::string namespace_, PHLMONITOR pMonitor, zwlrLayerShellV1Layer layer);
~CLayerShellResource();
bool good();

View File

@@ -452,7 +452,7 @@ 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<CMonitor*>(param);
auto pMonitor = std::any_cast<PHLMONITOR>(param);
auto mon = pMonitor->self.lock();
auto tranche = SDMABUFTranche{
.device = mainDevice,
@@ -464,7 +464,7 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
});
static auto monitorRemoved = g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, SCallbackInfo& info, std::any param) {
auto pMonitor = std::any_cast<CMonitor*>(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; });
resetFormatTable();

View File

@@ -29,12 +29,12 @@ COutputManager::COutputManager(SP<CZwlrOutputManagerV1> resource_) : resource(re
// send all heads at start
for (auto const& m : g_pCompositor->m_vRealMonitors) {
if (m.get() == g_pCompositor->m_pUnsafeOutput)
if (m == g_pCompositor->m_pUnsafeOutput)
continue;
LOGM(LOG, " | sending output head for {}", m->szName);
makeAndSendNewHead(m.get());
makeAndSendNewHead(m);
}
sendDone();
@@ -44,7 +44,7 @@ bool COutputManager::good() {
return resource->resource();
}
void COutputManager::makeAndSendNewHead(CMonitor* pMonitor) {
void COutputManager::makeAndSendNewHead(PHLMONITOR pMonitor) {
if (stopped)
return;
@@ -63,7 +63,7 @@ void COutputManager::makeAndSendNewHead(CMonitor* pMonitor) {
RESOURCE->sendAllData();
}
void COutputManager::ensureMonitorSent(CMonitor* pMonitor) {
void COutputManager::ensureMonitorSent(PHLMONITOR pMonitor) {
if (pMonitor == g_pCompositor->m_pUnsafeOutput)
return;
@@ -86,7 +86,7 @@ void COutputManager::sendDone() {
resource->sendDone(wl_display_next_serial(g_pCompositor->m_sWLDisplay));
}
COutputHead::COutputHead(SP<CZwlrOutputHeadV1> resource_, CMonitor* pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
COutputHead::COutputHead(SP<CZwlrOutputHeadV1> resource_, PHLMONITOR pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
if (!good())
return;
@@ -105,7 +105,7 @@ COutputHead::COutputHead(SP<CZwlrOutputHeadV1> resource_, CMonitor* pMonitor_) :
m->resource->sendFinished();
}
pMonitor = nullptr;
pMonitor.reset();
for (auto const& m : PROTO::outputManagement->m_vManagers) {
m->sendDone();
}
@@ -221,8 +221,8 @@ void COutputHead::makeAndSendNewMode(SP<Aquamarine::SOutputMode> mode) {
RESOURCE->sendAllData();
}
CMonitor* COutputHead::monitor() {
return pMonitor;
PHLMONITOR COutputHead::monitor() {
return pMonitor.lock();
}
COutputMode::COutputMode(SP<CZwlrOutputModeV1> resource_, SP<Aquamarine::SOutputMode> mode_) : resource(resource_), mode(mode_) {
@@ -424,14 +424,12 @@ bool COutputConfiguration::applyTestConfiguration(bool test) {
return true;
}
COutputConfigurationHead::COutputConfigurationHead(SP<CZwlrOutputConfigurationHeadV1> resource_, CMonitor* pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
COutputConfigurationHead::COutputConfigurationHead(SP<CZwlrOutputConfigurationHeadV1> resource_, PHLMONITOR pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
if (!good())
return;
resource->setOnDestroy([this](CZwlrOutputConfigurationHeadV1* r) { PROTO::outputManagement->destroyResource(this); });
listeners.monitorDestroy = pMonitor->events.destroy.registerListener([this](std::any d) { pMonitor = nullptr; });
resource->setSetMode([this](CZwlrOutputConfigurationHeadV1* r, wl_resource* outputMode) {
const auto MODE = PROTO::outputManagement->modeFromResource(outputMode);
@@ -612,7 +610,7 @@ void COutputManagementProtocol::destroyResource(COutputConfigurationHead* resour
void COutputManagementProtocol::updateAllOutputs() {
for (auto const& m : g_pCompositor->m_vRealMonitors) {
for (auto const& mgr : m_vManagers) {
mgr->ensureMonitorSent(m.get());
mgr->ensureMonitorSent(m);
}
}
}

View File

@@ -56,7 +56,7 @@ class COutputManager {
COutputManager(SP<CZwlrOutputManagerV1> resource_);
bool good();
void ensureMonitorSent(CMonitor* pMonitor);
void ensureMonitorSent(PHLMONITOR pMonitor);
void sendDone();
// holds the states for this manager.
@@ -70,7 +70,7 @@ class COutputManager {
std::vector<WP<COutputHead>> heads;
void makeAndSendNewHead(CMonitor* pMonitor);
void makeAndSendNewHead(PHLMONITOR pMonitor);
friend class COutputManagementProtocol;
};
@@ -92,16 +92,16 @@ class COutputMode {
class COutputHead {
public:
COutputHead(SP<CZwlrOutputHeadV1> resource_, CMonitor* pMonitor_);
COutputHead(SP<CZwlrOutputHeadV1> resource_, PHLMONITOR pMonitor_);
bool good();
void sendAllData(); // this has to be separate as we need to send the head first, then set the data
void updateMode();
CMonitor* monitor();
bool good();
void sendAllData(); // this has to be separate as we need to send the head first, then set the data
void updateMode();
PHLMONITOR monitor();
private:
SP<CZwlrOutputHeadV1> resource;
CMonitor* pMonitor = nullptr;
PHLMONITORREF pMonitor;
void makeAndSendNewMode(SP<Aquamarine::SOutputMode> mode);
void sendCurrentMode();
@@ -119,7 +119,7 @@ class COutputHead {
class COutputConfigurationHead {
public:
COutputConfigurationHead(SP<CZwlrOutputConfigurationHeadV1> resource_, CMonitor* pMonitor_);
COutputConfigurationHead(SP<CZwlrOutputConfigurationHeadV1> resource_, PHLMONITOR pMonitor_);
bool good();
@@ -127,11 +127,7 @@ class COutputConfigurationHead {
private:
SP<CZwlrOutputConfigurationHeadV1> resource;
CMonitor* pMonitor = nullptr;
struct {
CHyprSignalListener monitorDestroy;
} listeners;
PHLMONITORREF pMonitor;
friend class COutputConfiguration;
};

View File

@@ -2,7 +2,7 @@
#include "../Compositor.hpp"
#include "core/Output.hpp"
COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, CMonitor* pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, PHLMONITOR pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
if (!resource->resource())
return;
@@ -24,7 +24,7 @@ COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, CMonitor* pMonitor_
resource->sendMode(pMonitor->dpmsStatus ? ZWLR_OUTPUT_POWER_V1_MODE_ON : ZWLR_OUTPUT_POWER_V1_MODE_OFF);
listeners.monitorDestroy = pMonitor->events.destroy.registerListener([this](std::any v) {
pMonitor = nullptr;
pMonitor.reset();
resource->sendFailed();
});
@@ -68,7 +68,7 @@ void COutputPowerProtocol::onGetOutputPower(CZwlrOutputPowerManagerV1* pMgr, uin
}
const auto CLIENT = pMgr->client();
const auto RESOURCE = m_vOutputPowers.emplace_back(std::make_unique<COutputPower>(makeShared<CZwlrOutputPowerV1>(CLIENT, pMgr->version(), id), OUTPUT->monitor.get())).get();
const auto RESOURCE = m_vOutputPowers.emplace_back(std::make_unique<COutputPower>(makeShared<CZwlrOutputPowerV1>(CLIENT, pMgr->version(), id), OUTPUT->monitor.lock())).get();
if (!RESOURCE->good()) {
pMgr->noMemory();

View File

@@ -11,14 +11,14 @@ class CMonitor;
class COutputPower {
public:
COutputPower(SP<CZwlrOutputPowerV1> resource_, CMonitor* pMonitor);
COutputPower(SP<CZwlrOutputPowerV1> resource_, PHLMONITOR pMonitor);
bool good();
private:
SP<CZwlrOutputPowerV1> resource;
CMonitor* pMonitor = nullptr;
PHLMONITORREF pMonitor;
struct {
CHyprSignalListener monitorDestroy;

View File

@@ -73,8 +73,8 @@ 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<CMonitor*>(param);
std::erase_if(m_vQueue, [PMONITOR](const auto& other) { return !other->surface || other->pMonitor.get() == PMONITOR; });
const auto PMONITOR = std::any_cast<PHLMONITOR>(param);
std::erase_if(m_vQueue, [PMONITOR](const auto& other) { return !other->surface || other->pMonitor == PMONITOR; });
});
}

View File

@@ -19,7 +19,7 @@ CScreencopyFrame::CScreencopyFrame(SP<CZwlrScreencopyFrameV1> resource_, int32_t
return;
overlayCursor = !!overlay_cursor;
pMonitor = CWLOutputResource::fromResource(output)->monitor.get();
pMonitor = CWLOutputResource::fromResource(output)->monitor;
if (!pMonitor) {
LOGM(ERR, "Client requested sharing of a monitor that doesnt exist");
@@ -38,7 +38,7 @@ CScreencopyFrame::CScreencopyFrame(SP<CZwlrScreencopyFrameV1> resource_, int32_t
g_pHyprRenderer->makeEGLCurrent();
shmFormat = g_pHyprOpenGL->getPreferredReadFormat(pMonitor);
shmFormat = g_pHyprOpenGL->getPreferredReadFormat(pMonitor.lock());
if (shmFormat == DRM_FORMAT_INVALID) {
LOGM(ERR, "No format supported by renderer in capture output");
resource->sendFailed();
@@ -87,7 +87,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
return;
}
if (!g_pCompositor->monitorExists(pMonitor)) {
if (!g_pCompositor->monitorExists(pMonitor.lock())) {
LOGM(ERR, "Client requested sharing of a monitor that is gone");
resource->sendFailed();
PROTO::screencopy->destroyResource(this);
@@ -165,7 +165,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
}
if (!withDamage)
g_pHyprRenderer->damageMonitor(pMonitor);
g_pHyprRenderer->damageMonitor(pMonitor.lock());
}
void CScreencopyFrame::share() {
@@ -205,7 +205,7 @@ bool CScreencopyFrame::copyDmabuf() {
CRegion fakeDamage = {0, 0, INT16_MAX, INT16_MAX};
if (!g_pHyprRenderer->beginRender(pMonitor, fakeDamage, RENDER_MODE_TO_BUFFER, buffer.lock(), nullptr, true)) {
if (!g_pHyprRenderer->beginRender(pMonitor.lock(), fakeDamage, RENDER_MODE_TO_BUFFER, buffer.lock(), nullptr, true)) {
LOGM(ERR, "Can't copy: failed to begin rendering to dma frame");
return false;
}
@@ -240,7 +240,7 @@ bool CScreencopyFrame::copyShm() {
CFramebuffer fb;
fb.alloc(box.w, box.h, pMonitor->output->state->state().drmFormat);
if (!g_pHyprRenderer->beginRender(pMonitor, fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, &fb, true)) {
if (!g_pHyprRenderer->beginRender(pMonitor.lock(), fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, &fb, true)) {
LOGM(ERR, "Can't copy: failed to begin rendering");
return false;
}
@@ -288,7 +288,7 @@ bool CScreencopyFrame::copyShm() {
}
}
g_pHyprOpenGL->m_RenderData.pMonitor = nullptr;
g_pHyprOpenGL->m_RenderData.pMonitor.reset();
LOGM(TRACE, "Copied frame via shm");
@@ -402,7 +402,7 @@ void CScreencopyProtocol::destroyResource(CScreencopyFrame* frame) {
std::erase_if(m_vFramesAwaitingWrite, [&](const auto& other) { return !other || other.get() == frame; });
}
void CScreencopyProtocol::onOutputCommit(CMonitor* pMonitor) {
void CScreencopyProtocol::onOutputCommit(PHLMONITOR pMonitor) {
if (m_vFramesAwaitingWrite.empty()) {
g_pHyprRenderer->m_bDirectScanoutBlocked = false;
return; // nothing to share

View File

@@ -60,7 +60,7 @@ class CScreencopyFrame {
private:
SP<CZwlrScreencopyFrameV1> resource;
CMonitor* pMonitor = nullptr;
PHLMONITORREF pMonitor;
bool overlayCursor = false;
bool withDamage = false;
bool lockedSWCursors = false;
@@ -88,7 +88,7 @@ class CScreencopyProtocol : public IWaylandProtocol {
void destroyResource(CScreencopyClient* resource);
void destroyResource(CScreencopyFrame* resource);
void onOutputCommit(CMonitor* pMonitor);
void onOutputCommit(PHLMONITOR pMonitor);
private:
std::vector<SP<CScreencopyFrame>> m_vFrames;
@@ -98,7 +98,7 @@ class CScreencopyProtocol : public IWaylandProtocol {
SP<CEventLoopTimer> m_pSoftwareCursorTimer;
bool m_bTimerArmed = false;
void shareAllFrames(CMonitor* pMonitor);
void shareAllFrames(PHLMONITOR pMonitor);
void shareFrame(CScreencopyFrame* frame);
void sendFrameDamage(CScreencopyFrame* frame);
bool copyFrameDmabuf(CScreencopyFrame* frame);

View File

@@ -5,7 +5,7 @@
#include "core/Compositor.hpp"
#include "core/Output.hpp"
CSessionLockSurface::CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_, SP<CWLSurfaceResource> surface_, CMonitor* pMonitor_, WP<CSessionLock> owner_) :
CSessionLockSurface::CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_, SP<CWLSurfaceResource> surface_, PHLMONITOR pMonitor_, WP<CSessionLock> owner_) :
resource(resource_), sessionLock(owner_), pSurface(surface_), pMonitor(pMonitor_) {
if (!resource->resource())
return;
@@ -82,8 +82,8 @@ bool CSessionLockSurface::inert() {
return sessionLock.expired();
}
CMonitor* CSessionLockSurface::monitor() {
return pMonitor;
PHLMONITOR CSessionLockSurface::monitor() {
return pMonitor.lock();
}
SP<CWLSurfaceResource> CSessionLockSurface::surface() {
@@ -184,7 +184,7 @@ void CSessionLockProtocol::onGetLockSurface(CExtSessionLockV1* lock, uint32_t id
LOGM(LOG, "New sessionLockSurface with id {}", id);
auto PSURFACE = CWLSurfaceResource::fromResource(surface);
auto PMONITOR = CWLOutputResource::fromResource(output)->monitor.get();
auto PMONITOR = CWLOutputResource::fromResource(output)->monitor.lock();
SP<CSessionLock> sessionLock;
for (auto const& l : m_vLocks) {

View File

@@ -13,12 +13,12 @@ class CWLSurfaceResource;
class CSessionLockSurface {
public:
CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_, SP<CWLSurfaceResource> surface_, CMonitor* pMonitor_, WP<CSessionLock> owner_);
CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_, SP<CWLSurfaceResource> surface_, PHLMONITOR pMonitor_, WP<CSessionLock> owner_);
~CSessionLockSurface();
bool good();
bool inert();
CMonitor* monitor();
PHLMONITOR monitor();
SP<CWLSurfaceResource> surface();
struct {
@@ -31,7 +31,7 @@ class CSessionLockSurface {
SP<CExtSessionLockSurfaceV1> resource;
WP<CSessionLock> sessionLock;
WP<CWLSurfaceResource> pSurface;
CMonitor* pMonitor = nullptr;
PHLMONITORREF pMonitor;
bool ackdConfigure = false;
bool committed = false;

View File

@@ -362,7 +362,7 @@ void CToplevelExportProtocol::destroyResource(CToplevelExportFrame* frame) {
std::erase_if(m_vFramesAwaitingWrite, [&](const auto& other) { return !other || other.get() == frame; });
}
void CToplevelExportProtocol::onOutputCommit(CMonitor* pMonitor) {
void CToplevelExportProtocol::onOutputCommit(PHLMONITOR pMonitor) {
if (m_vFramesAwaitingWrite.empty())
return; // nothing to share

View File

@@ -80,7 +80,7 @@ class CToplevelExportProtocol : IWaylandProtocol {
void destroyResource(CToplevelExportFrame* frame);
void onWindowUnmap(PHLWINDOW pWindow);
void onOutputCommit(CMonitor* pMonitor);
void onOutputCommit(PHLMONITOR pMonitor);
private:
std::vector<SP<CToplevelExportClient>> m_vClients;

View File

@@ -681,7 +681,7 @@ void CWLDataDeviceProtocol::abortDrag() {
g_pSeatManager->resendEnterEvents();
}
void CWLDataDeviceProtocol::renderDND(CMonitor* pMonitor, timespec* when) {
void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, timespec* when) {
if (!dnd.dndSurface || !dnd.dndSurface->current.texture)
return;

View File

@@ -131,7 +131,7 @@ class CWLDataDeviceProtocol : public IWaylandProtocol {
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
// renders and damages the dnd icon, if present
void renderDND(CMonitor* pMonitor, timespec* when);
void renderDND(PHLMONITOR pMonitor, timespec* when);
// for inputmgr to force refocus
// TODO: move handling to seatmgr
bool dndActive();