mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-18 12:42:13 +01:00
remove ensureFDsValid, legacy
This commit is contained in:
parent
0d7176792b
commit
6ddfae0a07
2 changed files with 0 additions and 24 deletions
|
@ -72,8 +72,6 @@ void CEventManager::startThread() {
|
||||||
// add to event loop so we can close it when we need to
|
// add to event loop so we can close it when we need to
|
||||||
m_dAcceptedSocketFDs.push_back({ACCEPTEDCONNECTION, wl_event_loop_add_fd(g_pCompositor->m_sWLEventLoop, ACCEPTEDCONNECTION, WL_EVENT_READABLE, fdHandleWrite, &m_dAcceptedSocketFDs)});
|
m_dAcceptedSocketFDs.push_back({ACCEPTEDCONNECTION, wl_event_loop_add_fd(g_pCompositor->m_sWLEventLoop, ACCEPTEDCONNECTION, WL_EVENT_READABLE, fdHandleWrite, &m_dAcceptedSocketFDs)});
|
||||||
}
|
}
|
||||||
|
|
||||||
ensureFDsValid();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(SOCKET);
|
close(SOCKET);
|
||||||
|
@ -82,28 +80,7 @@ void CEventManager::startThread() {
|
||||||
m_tThread.detach();
|
m_tThread.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEventManager::ensureFDsValid() {
|
|
||||||
static char readBuf[1024] = {0};
|
|
||||||
|
|
||||||
// pong if all FDs valid
|
|
||||||
for (auto it = m_dAcceptedSocketFDs.begin(); it != m_dAcceptedSocketFDs.end();) {
|
|
||||||
auto sizeRead = recv(it->first, &readBuf, 1024, 0);
|
|
||||||
|
|
||||||
if (sizeRead != 0) {
|
|
||||||
it++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// invalid!
|
|
||||||
Debug::log(LOG, "Removed invalid socket (2) FD: %d", *it);
|
|
||||||
it = m_dAcceptedSocketFDs.erase(it);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEventManager::flushEvents() {
|
void CEventManager::flushEvents() {
|
||||||
|
|
||||||
ensureFDsValid();
|
|
||||||
|
|
||||||
eventQueueMutex.lock();
|
eventQueueMutex.lock();
|
||||||
|
|
||||||
for (auto& ev : m_dQueuedEvents) {
|
for (auto& ev : m_dQueuedEvents) {
|
||||||
|
|
|
@ -26,7 +26,6 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void flushEvents();
|
void flushEvents();
|
||||||
void ensureFDsValid();
|
|
||||||
|
|
||||||
std::mutex eventQueueMutex;
|
std::mutex eventQueueMutex;
|
||||||
std::deque<SHyprIPCEvent> m_dQueuedEvents;
|
std::deque<SHyprIPCEvent> m_dQueuedEvents;
|
||||||
|
|
Loading…
Add table
Reference in a new issue