| 1877 | } |
| 1878 | |
| 1879 | bool Server::addClient(BaseClientProxy *client) |
| 1880 | { |
| 1881 | std::string name = getName(client); |
| 1882 | if (m_clients.contains(name)) { |
| 1883 | return false; |
| 1884 | } |
| 1885 | |
| 1886 | // add event handlers |
| 1887 | m_events->addHandler(EventTypes::ScreenShapeChanged, client->getEventTarget(), [this, client](const auto &) { |
| 1888 | handleShapeChanged(client); |
| 1889 | }); |
| 1890 | m_events->addHandler(EventTypes::ClipboardGrabbed, client->getEventTarget(), [this, client](const auto &e) { |
| 1891 | handleClipboardGrabbed(e, client); |
| 1892 | }); |
| 1893 | m_events->addHandler(EventTypes::ClipboardChanged, client->getEventTarget(), [this, client](const auto &e) { |
| 1894 | handleClipboardChanged(e, client); |
| 1895 | }); |
| 1896 | |
| 1897 | // add to list |
| 1898 | m_clientSet.insert(client); |
| 1899 | m_clients.insert(std::make_pair(name, client)); |
| 1900 | |
| 1901 | // initialize client data |
| 1902 | int32_t x; |
| 1903 | int32_t y; |
| 1904 | client->getCursorPos(x, y); |
| 1905 | client->setJumpCursorPos(x, y); |
| 1906 | |
| 1907 | // tell primary client about the active sides |
| 1908 | m_primaryClient->reconfigure(getActivePrimarySides()); |
| 1909 | |
| 1910 | return true; |
| 1911 | } |
| 1912 | |
| 1913 | bool Server::removeClient(BaseClientProxy *client) |
| 1914 | { |
nothing calls this directly
no test coverage detected