Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show First 20 Lines • Show All 757 Lines • ▼ Show 20 Line(s) | 757 | if (findClient(id)) { | |||
---|---|---|---|---|---|
758 | qCWarning(KWIN_CORE) << "Invalid client windowId generated:" << id; | 758 | qCWarning(KWIN_CORE) << "Invalid client windowId generated:" << id; | ||
759 | return 0; | 759 | return 0; | ||
760 | } | 760 | } | ||
761 | return id; | 761 | return id; | ||
762 | } | 762 | } | ||
763 | 763 | | |||
764 | quint16 WaylandServer::createClientId(ClientConnection *c) | 764 | quint16 WaylandServer::createClientId(ClientConnection *c) | ||
765 | { | 765 | { | ||
766 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) | | |||
767 | const QSet<unsigned short> ids(m_clientIds.constBegin(), m_clientIds.constEnd()); | 766 | const QSet<unsigned short> ids(m_clientIds.constBegin(), m_clientIds.constEnd()); | ||
768 | #else | | |||
769 | const auto ids = m_clientIds.values().toSet(); | | |||
770 | #endif | | |||
771 | quint16 id = 1; | 767 | quint16 id = 1; | ||
772 | if (!ids.isEmpty()) { | 768 | if (!ids.isEmpty()) { | ||
773 | for (quint16 i = ids.count() + 1; i >= 1 ; i--) { | 769 | for (quint16 i = ids.count() + 1; i >= 1 ; i--) { | ||
774 | if (!ids.contains(i)) { | 770 | if (!ids.contains(i)) { | ||
775 | id = i; | 771 | id = i; | ||
776 | break; | 772 | break; | ||
777 | } | 773 | } | ||
778 | } | 774 | } | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |