MCPcopy Create free account
hub / github.com/deskflow/deskflow / forceLeaveClient

Method forceLeaveClient

src/lib/server/Server.cpp:2017–2054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2015}
2016
2017void Server::forceLeaveClient(const BaseClientProxy *client)
2018{
2019 if (const auto *active = (m_activeSaver != nullptr) ? m_activeSaver : m_active; active == client) {
2020 // record new position (center of primary screen)
2021 m_primaryClient->getCursorCenter(m_x, m_y);
2022
2023 // stop waiting to switch to this client
2024 if (active == m_switchScreen) {
2025 stopSwitch();
2026 }
2027
2028 // don't notify active screen since it has probably already
2029 // disconnected.
2030 LOG(
2031 (CLOG_INFO "jump from \"%s\" to \"%s\" at %d,%d", getName(active).c_str(), getName(m_primaryClient).c_str(),
2032 m_x, m_y)
2033 );
2034
2035 // cut over
2036 m_active = m_primaryClient;
2037
2038 // enter new screen (unless we already have because of the
2039 // screen saver)
2040 if (m_activeSaver == nullptr) {
2041 m_primaryClient->enter(m_x, m_y, m_seqNum, m_primaryClient->getToggleMask(), false);
2042 }
2043 }
2044
2045 // if this screen had the cursor when the screen saver activated
2046 // then we can't switch back to it when the screen saver
2047 // deactivates.
2048 if (m_activeSaver == client) {
2049 m_activeSaver = nullptr;
2050 }
2051
2052 // tell primary client about the active sides
2053 m_primaryClient->reconfigure(getActivePrimarySides());
2054}

Callers

nothing calls this directly

Calls 4

getToggleMaskMethod · 0.80
getCursorCenterMethod · 0.45
enterMethod · 0.45
reconfigureMethod · 0.45

Tested by

no test coverage detected