summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-05-04 19:21:36 +0200
committerGitHub <noreply@github.com>2025-05-04 19:21:36 +0200
commit2626f89ea6fe0df585df28052bf1fcca2c50fe8e (patch)
tree6dd030f42e065e1a927ab907222e1efaf21b0bc1 /src/managers
parentadbae0f74d951e06c575bad3c81a944027dfe413 (diff)
protocols: refactor class member vars (n-t) (#10273)
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/SessionLockManager.cpp14
-rw-r--r--src/managers/input/InputMethodRelay.cpp4
-rw-r--r--src/managers/input/TextInput.cpp74
3 files changed, 46 insertions, 46 deletions
diff --git a/src/managers/SessionLockManager.cpp b/src/managers/SessionLockManager.cpp
index bb01c944..f39acf23 100644
--- a/src/managers/SessionLockManager.cpp
+++ b/src/managers/SessionLockManager.cpp
@@ -12,7 +12,7 @@
SSessionLockSurface::SSessionLockSurface(SP<CSessionLockSurface> surface_) : surface(surface_) {
pWlrSurface = surface->surface();
- listeners.map = surface_->events.map.registerListener([this](std::any data) {
+ listeners.map = surface_->m_events.map.registerListener([this](std::any data) {
mapped = true;
g_pInputManager->simulateMouseMovement();
@@ -23,14 +23,14 @@ SSessionLockSurface::SSessionLockSurface(SP<CSessionLockSurface> surface_) : sur
g_pHyprRenderer->damageMonitor(PMONITOR);
});
- listeners.destroy = surface_->events.destroy.registerListener([this](std::any data) {
+ listeners.destroy = surface_->m_events.destroy.registerListener([this](std::any data) {
if (pWlrSurface == g_pCompositor->m_lastFocus)
g_pCompositor->m_lastFocus.reset();
g_pSessionLockManager->removeSessionLockSurface(this);
});
- listeners.commit = surface_->events.commit.registerListener([this](std::any data) {
+ listeners.commit = surface_->m_events.commit.registerListener([this](std::any data) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(iMonitorID);
if (mapped && !g_pCompositor->m_lastFocus)
@@ -42,7 +42,7 @@ SSessionLockSurface::SSessionLockSurface(SP<CSessionLockSurface> surface_) : sur
}
CSessionLockManager::CSessionLockManager() {
- m_listeners.newLock = PROTO::sessionLock->events.newLock.registerListener([this](std::any data) { this->onNewSessionLock(std::any_cast<SP<CSessionLock>>(data)); });
+ m_listeners.newLock = PROTO::sessionLock->m_events.newLock.registerListener([this](std::any data) { this->onNewSessionLock(std::any_cast<SP<CSessionLock>>(data)); });
}
void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
@@ -61,7 +61,7 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
m_sessionLock->lock = pLock;
m_sessionLock->mLockTimer.reset();
- m_sessionLock->listeners.newSurface = pLock->events.newLockSurface.registerListener([this](std::any data) {
+ m_sessionLock->listeners.newSurface = pLock->m_events.newLockSurface.registerListener([this](std::any data) {
auto SURFACE = std::any_cast<SP<CSessionLockSurface>>(data);
const auto PMONITOR = SURFACE->monitor();
@@ -71,7 +71,7 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
PROTO::fractional->sendScale(SURFACE->surface(), PMONITOR->m_scale);
});
- m_sessionLock->listeners.unlock = pLock->events.unlockAndDestroy.registerListener([this](std::any data) {
+ m_sessionLock->listeners.unlock = pLock->m_events.unlockAndDestroy.registerListener([this](std::any data) {
m_sessionLock.reset();
g_pInputManager->refocus();
@@ -79,7 +79,7 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
g_pHyprRenderer->damageMonitor(m);
});
- m_sessionLock->listeners.destroy = pLock->events.destroyed.registerListener([this](std::any data) {
+ m_sessionLock->listeners.destroy = pLock->m_events.destroyed.registerListener([this](std::any data) {
m_sessionLock.reset();
g_pCompositor->focusSurface(nullptr);
diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp
index 050734a8..40c87f95 100644
--- a/src/managers/input/InputMethodRelay.cpp
+++ b/src/managers/input/InputMethodRelay.cpp
@@ -11,8 +11,8 @@ CInputMethodRelay::CInputMethodRelay() {
static auto P =
g_pHookSystem->hookDynamic("keyboardFocus", [&](void* self, SCallbackInfo& info, std::any param) { onKeyboardFocus(std::any_cast<SP<CWLSurfaceResource>>(param)); });
- m_listeners.newTIV3 = PROTO::textInputV3->events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV3>>(ti)); });
- m_listeners.newTIV1 = PROTO::textInputV1->events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV1>>(ti)); });
+ m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV3>>(ti)); });
+ m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV1>>(ti)); });
m_listeners.newIME = PROTO::ime->m_events.newIME.registerListener([this](std::any ime) { onNewIME(std::any_cast<SP<CInputMethodV2>>(ime)); });
}
diff --git a/src/managers/input/TextInput.cpp b/src/managers/input/TextInput.cpp
index c563f4de..cac64da4 100644
--- a/src/managers/input/TextInput.cpp
+++ b/src/managers/input/TextInput.cpp
@@ -19,11 +19,11 @@ void CTextInput::initCallbacks() {
if (isV3()) {
const auto INPUT = m_v3Input.lock();
- m_listeners.enable = INPUT->events.enable.registerListener([this](std::any p) { onEnabled(); });
- m_listeners.disable = INPUT->events.disable.registerListener([this](std::any p) { onDisabled(); });
- m_listeners.commit = INPUT->events.onCommit.registerListener([this](std::any p) { onCommit(); });
- m_listeners.reset = INPUT->events.reset.registerListener([this](std::any p) { onReset(); });
- m_listeners.destroy = INPUT->events.destroy.registerListener([this](std::any p) {
+ m_listeners.enable = INPUT->m_events.enable.registerListener([this](std::any p) { onEnabled(); });
+ m_listeners.disable = INPUT->m_events.disable.registerListener([this](std::any p) { onDisabled(); });
+ m_listeners.commit = INPUT->m_events.onCommit.registerListener([this](std::any p) { onCommit(); });
+ m_listeners.reset = INPUT->m_events.reset.registerListener([this](std::any p) { onReset(); });
+ m_listeners.destroy = INPUT->m_events.destroy.registerListener([this](std::any p) {
m_listeners.surfaceUnmap.reset();
m_listeners.surfaceDestroy.reset();
g_pInputManager->m_relay.removeTextInput(this);
@@ -36,14 +36,14 @@ void CTextInput::initCallbacks() {
} else {
const auto INPUT = m_v1Input.lock();
- m_listeners.enable = INPUT->events.enable.registerListener([this](std::any p) {
+ m_listeners.enable = INPUT->m_events.enable.registerListener([this](std::any p) {
const auto SURFACE = std::any_cast<SP<CWLSurfaceResource>>(p);
onEnabled(SURFACE);
});
- m_listeners.disable = INPUT->events.disable.registerListener([this](std::any p) { onDisabled(); });
- m_listeners.commit = INPUT->events.onCommit.registerListener([this](std::any p) { onCommit(); });
- m_listeners.reset = INPUT->events.reset.registerListener([this](std::any p) { onReset(); });
- m_listeners.destroy = INPUT->events.destroy.registerListener([this](std::any p) {
+ m_listeners.disable = INPUT->m_events.disable.registerListener([this](std::any p) { onDisabled(); });
+ m_listeners.commit = INPUT->m_events.onCommit.registerListener([this](std::any p) { onCommit(); });
+ m_listeners.reset = INPUT->m_events.reset.registerListener([this](std::any p) { onReset(); });
+ m_listeners.destroy = INPUT->m_events.destroy.registerListener([this](std::any p) {
m_listeners.surfaceUnmap.reset();
m_listeners.surfaceDestroy.reset();
g_pInputManager->m_relay.removeTextInput(this);
@@ -63,7 +63,7 @@ void CTextInput::onEnabled(SP<CWLSurfaceResource> surfV1) {
// v1 only, map surface to PTI
if (!isV3()) {
- if (g_pCompositor->m_lastFocus != surfV1 || !m_v1Input->active)
+ if (g_pCompositor->m_lastFocus != surfV1 || !m_v1Input->m_active)
return;
enter(surfV1);
@@ -115,7 +115,7 @@ void CTextInput::onCommit() {
return;
}
- if (!(isV3() ? m_v3Input->current.enabled.value : m_v1Input->active)) {
+ if (!(isV3() ? m_v3Input->m_current.enabled.value : m_v1Input->m_active)) {
Debug::log(WARN, "Disabled TextInput commit?");
return;
}
@@ -144,11 +144,11 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
m_listeners.surfaceUnmap.reset();
m_listeners.surfaceDestroy.reset();
- if (isV3() && !m_v3Input.expired() && m_v3Input->current.enabled.value) {
- m_v3Input->pending.enabled.value = false;
- m_v3Input->pending.enabled.isDisablePending = false;
- m_v3Input->pending.enabled.isEnablePending = false;
- m_v3Input->current.enabled.value = false;
+ if (isV3() && !m_v3Input.expired() && m_v3Input->m_current.enabled.value) {
+ m_v3Input->m_pending.enabled.value = false;
+ m_v3Input->m_pending.enabled.isDisablePending = false;
+ m_v3Input->m_pending.enabled.isEnablePending = false;
+ m_v3Input->m_current.enabled.value = false;
}
if (!g_pInputManager->m_relay.getFocusedTextInput())
@@ -164,11 +164,11 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
m_listeners.surfaceUnmap.reset();
m_listeners.surfaceDestroy.reset();
- if (isV3() && !m_v3Input.expired() && m_v3Input->current.enabled.value) {
- m_v3Input->pending.enabled.value = false;
- m_v3Input->pending.enabled.isDisablePending = false;
- m_v3Input->pending.enabled.isEnablePending = false;
- m_v3Input->current.enabled.value = false;
+ if (isV3() && !m_v3Input.expired() && m_v3Input->m_current.enabled.value) {
+ m_v3Input->m_pending.enabled.value = false;
+ m_v3Input->m_pending.enabled.isDisablePending = false;
+ m_v3Input->m_pending.enabled.isEnablePending = false;
+ m_v3Input->m_current.enabled.value = false;
}
if (!g_pInputManager->m_relay.getFocusedTextInput())
@@ -238,23 +238,23 @@ void CTextInput::commitStateToIME(SP<CInputMethodV2> ime) {
if (isV3() && !m_v3Input.expired()) {
const auto INPUT = m_v3Input.lock();
- if (INPUT->current.surrounding.updated)
- ime->surroundingText(INPUT->current.surrounding.text, INPUT->current.surrounding.cursor, INPUT->current.surrounding.anchor);
+ if (INPUT->m_current.surrounding.updated)
+ ime->surroundingText(INPUT->m_current.surrounding.text, INPUT->m_current.surrounding.cursor, INPUT->m_current.surrounding.anchor);
- ime->textChangeCause(INPUT->current.cause);
+ ime->textChangeCause(INPUT->m_current.cause);
- if (INPUT->current.contentType.updated)
- ime->textContentType(INPUT->current.contentType.hint, INPUT->current.contentType.purpose);
+ if (INPUT->m_current.contentType.updated)
+ ime->textContentType(INPUT->m_current.contentType.hint, INPUT->m_current.contentType.purpose);
} else if (!m_v1Input.expired()) {
const auto INPUT = m_v1Input.lock();
- if (INPUT->pendingSurrounding.isPending)
- ime->surroundingText(INPUT->pendingSurrounding.text, INPUT->pendingSurrounding.cursor, INPUT->pendingSurrounding.anchor);
+ if (INPUT->m_pendingSurrounding.isPending)
+ ime->surroundingText(INPUT->m_pendingSurrounding.text, INPUT->m_pendingSurrounding.cursor, INPUT->m_pendingSurrounding.anchor);
ime->textChangeCause(ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD);
- if (m_v1Input->pendingContentType.isPending)
- ime->textContentType((zwpTextInputV3ContentHint)INPUT->pendingContentType.hint, (zwpTextInputV3ContentPurpose)INPUT->pendingContentType.purpose);
+ if (m_v1Input->m_pendingContentType.isPending)
+ ime->textContentType((zwpTextInputV3ContentHint)INPUT->m_pendingContentType.hint, (zwpTextInputV3ContentPurpose)INPUT->m_pendingContentType.purpose);
}
g_pInputManager->m_relay.updateAllPopups();
@@ -282,30 +282,30 @@ void CTextInput::updateIMEState(SP<CInputMethodV2> ime) {
if (ime->m_current.preeditString.committed) {
INPUT->preeditCursor(ime->m_current.preeditString.begin);
INPUT->preeditStyling(0, std::string(ime->m_current.preeditString.string).length(), ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_HIGHLIGHT);
- INPUT->preeditString(m_v1Input->serial, ime->m_current.preeditString.string.c_str(), "");
+ INPUT->preeditString(m_v1Input->m_serial, ime->m_current.preeditString.string.c_str(), "");
} else {
INPUT->preeditCursor(0);
INPUT->preeditStyling(0, 0, ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_HIGHLIGHT);
- INPUT->preeditString(m_v1Input->serial, "", "");
+ INPUT->preeditString(m_v1Input->m_serial, "", "");
}
if (ime->m_current.committedString.committed)
- INPUT->commitString(m_v1Input->serial, ime->m_current.committedString.string.c_str());
+ INPUT->commitString(m_v1Input->m_serial, ime->m_current.committedString.string.c_str());
if (ime->m_current.deleteSurrounding.committed) {
INPUT->deleteSurroundingText(std::string(ime->m_current.preeditString.string).length() - ime->m_current.deleteSurrounding.before,
ime->m_current.deleteSurrounding.after + ime->m_current.deleteSurrounding.before);
if (ime->m_current.preeditString.committed)
- INPUT->commitString(m_v1Input->serial, ime->m_current.preeditString.string.c_str());
+ INPUT->commitString(m_v1Input->m_serial, ime->m_current.preeditString.string.c_str());
}
}
}
bool CTextInput::hasCursorRectangle() {
- return !isV3() || m_v3Input->current.box.updated;
+ return !isV3() || m_v3Input->m_current.box.updated;
}
CBox CTextInput::cursorBox() {
- return CBox{isV3() ? m_v3Input->current.box.cursorBox : m_v1Input->cursorRectangle};
+ return CBox{isV3() ? m_v3Input->m_current.box.cursorBox : m_v1Input->m_cursorRectangle};
}