summaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-05-02 17:07:20 +0200
committerGitHub <noreply@github.com>2025-05-02 17:07:20 +0200
commitce821294e21978cadf4c3facbeec421b245ea2c9 (patch)
treeaa90efb5251160cd1ed37fc9443f596f80f6dd96 /src/protocols
parent6f174a9e0892aab5c4c17a7da9be7f92bcdcebec (diff)
managers: refactor class member vars (#10242)
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/DataDeviceWlr.cpp4
-rw-r--r--src/protocols/FocusGrab.cpp10
-rw-r--r--src/protocols/InputMethodV2.cpp4
-rw-r--r--src/protocols/PointerConstraints.cpp2
-rw-r--r--src/protocols/PointerGestures.cpp50
-rw-r--r--src/protocols/PrimarySelection.cpp16
-rw-r--r--src/protocols/RelativePointer.cpp4
-rw-r--r--src/protocols/Tablet.cpp2
-rw-r--r--src/protocols/ToplevelExport.cpp2
-rw-r--r--src/protocols/XDGShell.cpp6
-rw-r--r--src/protocols/core/DataDevice.cpp42
-rw-r--r--src/protocols/core/Seat.cpp16
12 files changed, 79 insertions, 79 deletions
diff --git a/src/protocols/DataDeviceWlr.cpp b/src/protocols/DataDeviceWlr.cpp
index 3da5afd6..680840da 100644
--- a/src/protocols/DataDeviceWlr.cpp
+++ b/src/protocols/DataDeviceWlr.cpp
@@ -154,8 +154,8 @@ wl_client* CWLRDataDevice::client() {
}
void CWLRDataDevice::sendInitialSelections() {
- PROTO::dataWlr->sendSelectionToDevice(self.lock(), g_pSeatManager->selection.currentSelection.lock(), false);
- PROTO::dataWlr->sendSelectionToDevice(self.lock(), g_pSeatManager->selection.currentPrimarySelection.lock(), true);
+ PROTO::dataWlr->sendSelectionToDevice(self.lock(), g_pSeatManager->m_selection.currentSelection.lock(), false);
+ PROTO::dataWlr->sendSelectionToDevice(self.lock(), g_pSeatManager->m_selection.currentPrimarySelection.lock(), true);
}
void CWLRDataDevice::sendDataOffer(SP<CWLRDataOffer> offer) {
diff --git a/src/protocols/FocusGrab.cpp b/src/protocols/FocusGrab.cpp
index bef69f62..9a3e1c51 100644
--- a/src/protocols/FocusGrab.cpp
+++ b/src/protocols/FocusGrab.cpp
@@ -15,9 +15,9 @@ CFocusGrab::CFocusGrab(SP<CHyprlandFocusGrabV1> resource_) : resource(resource_)
if UNLIKELY (!resource->resource())
return;
- grab = makeShared<CSeatGrab>();
- grab->keyboard = true;
- grab->pointer = true;
+ grab = makeShared<CSeatGrab>();
+ grab->m_keyboard = true;
+ grab->m_pointer = true;
grab->setCallback([this]() { finish(true); });
resource->setDestroy([this](CHyprlandFocusGrabV1* pMgr) { PROTO::focusGrab->destroyGrab(this); });
@@ -58,7 +58,7 @@ void CFocusGrab::finish(bool sendCleared) {
if (m_bGrabActive) {
m_bGrabActive = false;
- if (g_pSeatManager->seatGrab == grab)
+ if (g_pSeatManager->m_seatGrab == grab)
g_pSeatManager->setGrab(nullptr);
grab->clear();
@@ -91,7 +91,7 @@ void CFocusGrab::eraseSurface(SP<CWLSurfaceResource> surface) {
}
void CFocusGrab::refocusKeyboard() {
- auto keyboardSurface = g_pSeatManager->state.keyboardFocus;
+ auto keyboardSurface = g_pSeatManager->m_state.keyboardFocus;
if (keyboardSurface && isSurfaceComitted(keyboardSurface.lock()))
return;
diff --git a/src/protocols/InputMethodV2.cpp b/src/protocols/InputMethodV2.cpp
index 6b022601..05cf90e1 100644
--- a/src/protocols/InputMethodV2.cpp
+++ b/src/protocols/InputMethodV2.cpp
@@ -13,12 +13,12 @@ CInputMethodKeyboardGrabV2::CInputMethodKeyboardGrabV2(SP<CZwpInputMethodKeyboar
resource->setRelease([this](CZwpInputMethodKeyboardGrabV2* r) { PROTO::ime->destroyResource(this); });
resource->setOnDestroy([this](CZwpInputMethodKeyboardGrabV2* r) { PROTO::ime->destroyResource(this); });
- if (!g_pSeatManager->keyboard) {
+ if (!g_pSeatManager->m_keyboard) {
LOGM(ERR, "IME called but no active keyboard???");
return;
}
- sendKeyboardData(g_pSeatManager->keyboard.lock());
+ sendKeyboardData(g_pSeatManager->m_keyboard.lock());
}
CInputMethodKeyboardGrabV2::~CInputMethodKeyboardGrabV2() {
diff --git a/src/protocols/PointerConstraints.cpp b/src/protocols/PointerConstraints.cpp
index 2858ee95..c97759d8 100644
--- a/src/protocols/PointerConstraints.cpp
+++ b/src/protocols/PointerConstraints.cpp
@@ -125,7 +125,7 @@ void CPointerConstraint::activate() {
return;
// TODO: hack, probably not a super duper great idea
- if (g_pSeatManager->state.pointerFocus != pHLSurface->resource()) {
+ if (g_pSeatManager->m_state.pointerFocus != pHLSurface->resource()) {
const auto SURFBOX = pHLSurface->getSurfaceBoxGlobal();
const auto LOCAL = SURFBOX.has_value() ? logicPositionHint() - SURFBOX->pos() : Vector2D{};
g_pSeatManager->setPointerFocus(pHLSurface->resource(), LOCAL);
diff --git a/src/protocols/PointerGestures.cpp b/src/protocols/PointerGestures.cpp
index 8de73ffa..e6c50dad 100644
--- a/src/protocols/PointerGestures.cpp
+++ b/src/protocols/PointerGestures.cpp
@@ -103,26 +103,26 @@ void CPointerGesturesProtocol::onGetHoldGesture(CZwpPointerGesturesV1* pMgr, uin
}
void CPointerGesturesProtocol::swipeBegin(uint32_t timeMs, uint32_t fingers) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
- const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->state.pointerFocusResource.lock());
+ const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->m_state.pointerFocusResource.lock());
for (auto const& sw : m_vSwipes) {
if (sw->resource->client() != FOCUSEDCLIENT)
continue;
- sw->resource->sendBegin(SERIAL, timeMs, g_pSeatManager->state.pointerFocus->getResource()->resource(), fingers);
+ sw->resource->sendBegin(SERIAL, timeMs, g_pSeatManager->m_state.pointerFocus->getResource()->resource(), fingers);
}
}
void CPointerGesturesProtocol::swipeUpdate(uint32_t timeMs, const Vector2D& delta) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
for (auto const& sw : m_vSwipes) {
if (sw->resource->client() != FOCUSEDCLIENT)
@@ -133,12 +133,12 @@ void CPointerGesturesProtocol::swipeUpdate(uint32_t timeMs, const Vector2D& delt
}
void CPointerGesturesProtocol::swipeEnd(uint32_t timeMs, bool cancelled) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
- const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->state.pointerFocusResource.lock());
+ const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->m_state.pointerFocusResource.lock());
for (auto const& sw : m_vSwipes) {
if (sw->resource->client() != FOCUSEDCLIENT)
@@ -149,26 +149,26 @@ void CPointerGesturesProtocol::swipeEnd(uint32_t timeMs, bool cancelled) {
}
void CPointerGesturesProtocol::pinchBegin(uint32_t timeMs, uint32_t fingers) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
- const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->state.pointerFocusResource.lock());
+ const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->m_state.pointerFocusResource.lock());
for (auto const& sw : m_vPinches) {
if (sw->resource->client() != FOCUSEDCLIENT)
continue;
- sw->resource->sendBegin(SERIAL, timeMs, g_pSeatManager->state.pointerFocus->getResource()->resource(), fingers);
+ sw->resource->sendBegin(SERIAL, timeMs, g_pSeatManager->m_state.pointerFocus->getResource()->resource(), fingers);
}
}
void CPointerGesturesProtocol::pinchUpdate(uint32_t timeMs, const Vector2D& delta, double scale, double rotation) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
for (auto const& sw : m_vPinches) {
if (sw->resource->client() != FOCUSEDCLIENT)
@@ -179,12 +179,12 @@ void CPointerGesturesProtocol::pinchUpdate(uint32_t timeMs, const Vector2D& delt
}
void CPointerGesturesProtocol::pinchEnd(uint32_t timeMs, bool cancelled) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
- const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->state.pointerFocusResource.lock());
+ const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->m_state.pointerFocusResource.lock());
for (auto const& sw : m_vPinches) {
if (sw->resource->client() != FOCUSEDCLIENT)
@@ -195,28 +195,28 @@ void CPointerGesturesProtocol::pinchEnd(uint32_t timeMs, bool cancelled) {
}
void CPointerGesturesProtocol::holdBegin(uint32_t timeMs, uint32_t fingers) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
- const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->state.pointerFocusResource.lock());
+ const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->m_state.pointerFocusResource.lock());
for (auto const& sw : m_vHolds) {
if (sw->resource->client() != FOCUSEDCLIENT)
continue;
- sw->resource->sendBegin(SERIAL, timeMs, g_pSeatManager->state.pointerFocus->getResource()->resource(), fingers);
+ sw->resource->sendBegin(SERIAL, timeMs, g_pSeatManager->m_state.pointerFocus->getResource()->resource(), fingers);
}
}
void CPointerGesturesProtocol::holdEnd(uint32_t timeMs, bool cancelled) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSEDCLIENT = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSEDCLIENT = g_pSeatManager->m_state.pointerFocusResource->client();
- const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->state.pointerFocusResource.lock());
+ const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->m_state.pointerFocusResource.lock());
for (auto const& sw : m_vHolds) {
if (sw->resource->client() != FOCUSEDCLIENT)
diff --git a/src/protocols/PrimarySelection.cpp b/src/protocols/PrimarySelection.cpp
index 620f262e..2cd610ec 100644
--- a/src/protocols/PrimarySelection.cpp
+++ b/src/protocols/PrimarySelection.cpp
@@ -228,7 +228,7 @@ void CPrimarySelectionProtocol::bindManager(wl_client* client, void* data, uint3
// we need to do it here because protocols come before seatMgr
if (!listeners.onPointerFocusChange)
- listeners.onPointerFocusChange = g_pSeatManager->events.pointerFocusChange.registerListener([this](std::any d) { this->onPointerFocus(); });
+ listeners.onPointerFocusChange = g_pSeatManager->m_events.pointerFocusChange.registerListener([this](std::any d) { this->onPointerFocus(); });
}
void CPrimarySelectionProtocol::destroyResource(CPrimarySelectionManager* resource) {
@@ -279,10 +279,10 @@ void CPrimarySelectionProtocol::setSelection(SP<IDataSource> source) {
if (!source) {
LOGM(LOG, "resetting selection");
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->state.pointerFocusResource->client());
+ auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.pointerFocusResource->client());
if (DESTDEVICE)
sendSelectionToDevice(DESTDEVICE, nullptr);
@@ -291,10 +291,10 @@ void CPrimarySelectionProtocol::setSelection(SP<IDataSource> source) {
LOGM(LOG, "New selection for data source {:x}", (uintptr_t)source.get());
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->state.pointerFocusResource->client());
+ auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.pointerFocusResource->client());
if (!DESTDEVICE) {
LOGM(LOG, "CWLDataDeviceProtocol::setSelection: cannot send selection to a client without a data_device");
@@ -305,17 +305,17 @@ void CPrimarySelectionProtocol::setSelection(SP<IDataSource> source) {
}
void CPrimarySelectionProtocol::updateSelection() {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->state.pointerFocusResource->client());
+ auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.pointerFocusResource->client());
if (!DESTDEVICE) {
LOGM(LOG, "CPrimarySelectionProtocol::updateSelection: cannot send selection to a client without a data_device");
return;
}
- sendSelectionToDevice(DESTDEVICE, g_pSeatManager->selection.currentPrimarySelection.lock());
+ sendSelectionToDevice(DESTDEVICE, g_pSeatManager->m_selection.currentPrimarySelection.lock());
}
void CPrimarySelectionProtocol::onPointerFocus() {
diff --git a/src/protocols/RelativePointer.cpp b/src/protocols/RelativePointer.cpp
index f002fac1..9876852f 100644
--- a/src/protocols/RelativePointer.cpp
+++ b/src/protocols/RelativePointer.cpp
@@ -59,10 +59,10 @@ void CRelativePointerProtocol::onGetRelativePointer(CZwpRelativePointerManagerV1
void CRelativePointerProtocol::sendRelativeMotion(uint64_t time, const Vector2D& delta, const Vector2D& deltaUnaccel) {
- if (!g_pSeatManager->state.pointerFocusResource)
+ if (!g_pSeatManager->m_state.pointerFocusResource)
return;
- const auto FOCUSED = g_pSeatManager->state.pointerFocusResource->client();
+ const auto FOCUSED = g_pSeatManager->m_state.pointerFocusResource->client();
for (auto const& rp : m_vRelativePointers) {
if (FOCUSED != rp->client())
diff --git a/src/protocols/Tablet.cpp b/src/protocols/Tablet.cpp
index 0aec67e1..58aaa54c 100644
--- a/src/protocols/Tablet.cpp
+++ b/src/protocols/Tablet.cpp
@@ -157,7 +157,7 @@ CTabletToolV2Resource::CTabletToolV2Resource(SP<CZwpTabletToolV2> resource_, SP<
resource->setOnDestroy([this](CZwpTabletToolV2* r) { PROTO::tablet->destroyResource(this); });
resource->setSetCursor([](CZwpTabletToolV2* r, uint32_t serial, wl_resource* surf, int32_t hot_x, int32_t hot_y) {
- if (!g_pSeatManager->state.pointerFocusResource || g_pSeatManager->state.pointerFocusResource->client() != r->client())
+ if (!g_pSeatManager->m_state.pointerFocusResource || g_pSeatManager->m_state.pointerFocusResource->client() != r->client())
return;
g_pInputManager->processMouseRequest(CSeatManager::SSetCursorEvent{surf ? CWLSurfaceResource::fromResource(surf) : nullptr, {hot_x, hot_y}});
diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp
index 9496acb2..57fc415e 100644
--- a/src/protocols/ToplevelExport.cpp
+++ b/src/protocols/ToplevelExport.cpp
@@ -372,7 +372,7 @@ bool CToplevelExportFrame::shouldOverlayCursor() const {
if (!cursorOverlayRequested)
return false;
- auto pointerSurfaceResource = g_pSeatManager->state.pointerFocus.lock();
+ auto pointerSurfaceResource = g_pSeatManager->m_state.pointerFocus.lock();
if (!pointerSurfaceResource)
return false;
diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp
index 59eca367..a82ba17e 100644
--- a/src/protocols/XDGShell.cpp
+++ b/src/protocols/XDGShell.cpp
@@ -764,9 +764,9 @@ void CXDGWMBase::ping() {
}
CXDGShellProtocol::CXDGShellProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
- grab = makeShared<CSeatGrab>();
- grab->keyboard = true;
- grab->pointer = true;
+ grab = makeShared<CSeatGrab>();
+ grab->m_keyboard = true;
+ grab->m_pointer = true;
grab->setCallback([this]() {
for (auto const& g : grabbed) {
g->done();
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index 1cd003f0..fda46980 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]() {
- listeners.onKeyboardFocusChange = g_pSeatManager->events.keyboardFocusChange.registerListener([this](std::any d) { onKeyboardFocus(); });
- listeners.onDndPointerFocusChange = g_pSeatManager->events.dndPointerFocusChange.registerListener([this](std::any d) { onDndPointerFocus(); });
+ listeners.onKeyboardFocusChange = g_pSeatManager->m_events.keyboardFocusChange.registerListener([this](std::any d) { onKeyboardFocus(); });
+ listeners.onDndPointerFocusChange = g_pSeatManager->m_events.dndPointerFocusChange.registerListener([this](std::any d) { onDndPointerFocus(); });
});
}
@@ -451,7 +451,7 @@ void CWLDataDeviceProtocol::sendSelectionToDevice(SP<IDataDevice> dev, SP<IDataS
}
#ifndef NO_XWAYLAND
else if (const auto X11 = dev->getX11(); X11)
- offer = g_pXWayland->pWM->createX11DataOffer(g_pSeatManager->state.keyboardFocus.lock(), sel);
+ offer = g_pXWayland->pWM->createX11DataOffer(g_pSeatManager->m_state.keyboardFocus.lock(), sel);
#endif
if UNLIKELY (!offer) {
@@ -482,10 +482,10 @@ void CWLDataDeviceProtocol::setSelection(SP<IDataSource> source) {
if (!source) {
LOGM(LOG, "resetting selection");
- if (!g_pSeatManager->state.keyboardFocusResource)
+ if (!g_pSeatManager->m_state.keyboardFocusResource)
return;
- auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->state.keyboardFocusResource->client());
+ auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.keyboardFocusResource->client());
if (DESTDEVICE && DESTDEVICE->type() == DATA_SOURCE_TYPE_WAYLAND)
sendSelectionToDevice(DESTDEVICE, nullptr);
@@ -494,10 +494,10 @@ void CWLDataDeviceProtocol::setSelection(SP<IDataSource> source) {
LOGM(LOG, "New selection for data source {:x}", (uintptr_t)source.get());
- if (!g_pSeatManager->state.keyboardFocusResource)
+ if (!g_pSeatManager->m_state.keyboardFocusResource)
return;
- auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->state.keyboardFocusResource->client());
+ auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.keyboardFocusResource->client());
if (!DESTDEVICE) {
LOGM(LOG, "CWLDataDeviceProtocol::setSelection: cannot send selection to a client without a data_device");
@@ -513,17 +513,17 @@ void CWLDataDeviceProtocol::setSelection(SP<IDataSource> source) {
}
void CWLDataDeviceProtocol::updateSelection() {
- if (!g_pSeatManager->state.keyboardFocusResource)
+ if (!g_pSeatManager->m_state.keyboardFocusResource)
return;
- auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->state.keyboardFocusResource->client());
+ auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.keyboardFocusResource->client());
if (!DESTDEVICE) {
LOGM(LOG, "CWLDataDeviceProtocol::onKeyboardFocus: cannot send selection to a client without a data_device");
return;
}
- sendSelectionToDevice(DESTDEVICE, g_pSeatManager->selection.currentSelection.lock());
+ sendSelectionToDevice(DESTDEVICE, g_pSeatManager->m_selection.currentSelection.lock());
}
void CWLDataDeviceProtocol::onKeyboardFocus() {
@@ -593,8 +593,8 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
dnd.mouseMove = g_pHookSystem->hookDynamic("mouseMove", [this](void* self, SCallbackInfo& info, std::any e) {
auto V = std::any_cast<const Vector2D>(e);
- if (dnd.focusedDevice && g_pSeatManager->state.dndPointerFocus) {
- auto surf = CWLSurface::fromResource(g_pSeatManager->state.dndPointerFocus.lock());
+ if (dnd.focusedDevice && g_pSeatManager->m_state.dndPointerFocus) {
+ auto surf = CWLSurface::fromResource(g_pSeatManager->m_state.dndPointerFocus.lock());
if (!surf)
return;
@@ -611,8 +611,8 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
dnd.touchMove = g_pHookSystem->hookDynamic("touchMove", [this](void* self, SCallbackInfo& info, std::any e) {
auto E = std::any_cast<ITouch::SMotionEvent>(e);
- if (dnd.focusedDevice && g_pSeatManager->state.dndPointerFocus) {
- auto surf = CWLSurface::fromResource(g_pSeatManager->state.dndPointerFocus.lock());
+ if (dnd.focusedDevice && g_pSeatManager->m_state.dndPointerFocus) {
+ auto surf = CWLSurface::fromResource(g_pSeatManager->m_state.dndPointerFocus.lock());
if (!surf)
return;
@@ -630,9 +630,9 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
// unfocus the pointer from the surface, this is part of """standard""" wayland procedure and gtk will freak out if this isn't happening.
// BTW, the spec does NOT require this explicitly...
// Fuck you gtk.
- const auto LASTDNDFOCUS = g_pSeatManager->state.dndPointerFocus;
+ const auto LASTDNDFOCUS = g_pSeatManager->m_state.dndPointerFocus;
g_pSeatManager->setPointerFocus(nullptr, {});
- g_pSeatManager->state.dndPointerFocus = LASTDNDFOCUS;
+ g_pSeatManager->m_state.dndPointerFocus = LASTDNDFOCUS;
// make a new offer, etc
updateDrag();
@@ -645,10 +645,10 @@ void CWLDataDeviceProtocol::updateDrag() {
if (dnd.focusedDevice)
dnd.focusedDevice->sendLeave();
- if (!g_pSeatManager->state.dndPointerFocus)
+ if (!g_pSeatManager->m_state.dndPointerFocus)
return;
- dnd.focusedDevice = dataDeviceForClient(g_pSeatManager->state.dndPointerFocus->client());
+ dnd.focusedDevice = dataDeviceForClient(g_pSeatManager->m_state.dndPointerFocus->client());
if (!dnd.focusedDevice)
return;
@@ -669,7 +669,7 @@ void CWLDataDeviceProtocol::updateDrag() {
}
#ifndef NO_XWAYLAND
else if (const auto X11 = dnd.focusedDevice->getX11(); X11)
- offer = g_pXWayland->pWM->createX11DataOffer(g_pSeatManager->state.keyboardFocus.lock(), dnd.currentSource.lock());
+ offer = g_pXWayland->pWM->createX11DataOffer(g_pSeatManager->m_state.keyboardFocus.lock(), dnd.currentSource.lock());
#endif
if (!offer) {
@@ -683,8 +683,8 @@ void CWLDataDeviceProtocol::updateDrag() {
dnd.focusedDevice->sendDataOffer(offer);
if (const auto WL = offer->getWayland(); WL)
WL->sendData();
- dnd.focusedDevice->sendEnter(wl_display_next_serial(g_pCompositor->m_wlDisplay), g_pSeatManager->state.dndPointerFocus.lock(),
- g_pSeatManager->state.dndPointerFocus->current.size / 2.F, offer);
+ dnd.focusedDevice->sendEnter(wl_display_next_serial(g_pCompositor->m_wlDisplay), g_pSeatManager->m_state.dndPointerFocus.lock(),
+ g_pSeatManager->m_state.dndPointerFocus->current.size / 2.F, offer);
}
void CWLDataDeviceProtocol::cleanupDndState(bool resetDevice, bool resetSource, bool simulateInput) {
diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp
index 5a704717..6dbed8fd 100644
--- a/src/protocols/core/Seat.cpp
+++ b/src/protocols/core/Seat.cpp
@@ -133,8 +133,8 @@ CWLPointerResource::CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResou
g_pSeatManager->onSetCursor(owner.lock(), serial, surfResource, {hotX, hotY});
});
- if (g_pSeatManager->state.pointerFocus && g_pSeatManager->state.pointerFocus->client() == resource->client())
- sendEnter(g_pSeatManager->state.pointerFocus.lock(), {-1, -1} /* Coords don't really matter that much, they will be updated next move */);
+ if (g_pSeatManager->m_state.pointerFocus && g_pSeatManager->m_state.pointerFocus->client() == resource->client())
+ sendEnter(g_pSeatManager->m_state.pointerFocus.lock(), {-1, -1} /* Coords don't really matter that much, they will be updated next move */);
}
int CWLPointerResource::version() {
@@ -297,16 +297,16 @@ CWLKeyboardResource::CWLKeyboardResource(SP<CWlKeyboard> resource_, SP<CWLSeatRe
resource->setRelease([this](CWlKeyboard* r) { PROTO::seat->destroyResource(this); });
resource->setOnDestroy([this](CWlKeyboard* r) { PROTO::seat->destroyResource(this); });
- if (!g_pSeatManager->keyboard) {
+ if (!g_pSeatManager->m_keyboard) {
LOGM(ERR, "No keyboard on bound wl_keyboard??");
return;
}
- sendKeymap(g_pSeatManager->keyboard.lock());
- repeatInfo(g_pSeatManager->keyboard->m_repeatRate, g_pSeatManager->keyboard->m_repeatDelay);
+ sendKeymap(g_pSeatManager->m_keyboard.lock());
+ repeatInfo(g_pSeatManager->m_keyboard->m_repeatRate, g_pSeatManager->m_keyboard->m_repeatDelay);
- if (g_pSeatManager->state.keyboardFocus && g_pSeatManager->state.keyboardFocus->client() == resource->client())
- sendEnter(g_pSeatManager->state.keyboardFocus.lock());
+ if (g_pSeatManager->m_state.keyboardFocus && g_pSeatManager->m_state.keyboardFocus->client() == resource->client())
+ sendEnter(g_pSeatManager->m_state.keyboardFocus.lock());
}
bool CWLKeyboardResource::good() {
@@ -533,7 +533,7 @@ void CWLSeatProtocol::updateKeymap() {
return;
for (auto const& k : m_vKeyboards) {
- k->sendKeymap(g_pSeatManager->keyboard.lock());
+ k->sendKeymap(g_pSeatManager->m_keyboard.lock());
}
}