Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show First 20 Lines • Show All 418 Lines • ▼ Show 20 Line(s) | 283 | { | |||
---|---|---|---|---|---|
419 | 419 | | |||
420 | m_decorationManager = m_display->createServerSideDecorationManager(m_display); | 420 | m_decorationManager = m_display->createServerSideDecorationManager(m_display); | ||
421 | connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, | 421 | connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, | ||
422 | [this] (ServerSideDecorationInterface *deco) { | 422 | [this] (ServerSideDecorationInterface *deco) { | ||
423 | if (XdgShellClient *c = findXdgShellClient(deco->surface())) { | 423 | if (XdgShellClient *c = findXdgShellClient(deco->surface())) { | ||
424 | c->installServerSideDecoration(deco); | 424 | c->installServerSideDecoration(deco); | ||
425 | } | 425 | } | ||
426 | connect(deco, &ServerSideDecorationInterface::modeRequested, this, | 426 | connect(deco, &ServerSideDecorationInterface::modeRequested, this, | ||
427 | [this, deco] (ServerSideDecorationManagerInterface::Mode mode) { | 427 | [deco] (ServerSideDecorationManagerInterface::Mode mode) { | ||
428 | // always acknowledge the requested mode | 428 | // always acknowledge the requested mode | ||
429 | deco->setMode(mode); | 429 | deco->setMode(mode); | ||
430 | } | 430 | } | ||
431 | ); | 431 | ); | ||
432 | } | 432 | } | ||
433 | ); | 433 | ); | ||
434 | m_decorationManager->create(); | 434 | m_decorationManager->create(); | ||
435 | 435 | | |||
436 | m_outputManagement = m_display->createOutputManagement(m_display); | 436 | m_outputManagement = m_display->createOutputManagement(m_display); | ||
437 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | 437 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | ||
438 | this, [this](KWayland::Server::OutputConfigurationInterface *config) { | 438 | this, [](KWayland::Server::OutputConfigurationInterface *config) { | ||
439 | kwinApp()->platform()->requestOutputsChange(config); | 439 | kwinApp()->platform()->requestOutputsChange(config); | ||
440 | }); | 440 | }); | ||
441 | m_outputManagement->create(); | 441 | m_outputManagement->create(); | ||
442 | 442 | | |||
443 | m_xdgOutputManager = m_display->createXdgOutputManager(m_display); | 443 | m_xdgOutputManager = m_display->createXdgOutputManager(m_display); | ||
444 | m_xdgOutputManager->create(); | 444 | m_xdgOutputManager->create(); | ||
445 | 445 | | |||
446 | m_display->createSubCompositor(m_display)->create(); | 446 | m_display->createSubCompositor(m_display)->create(); | ||
▲ Show 20 Lines • Show All 279 Lines • ▼ Show 20 Line(s) | 725 | if (findClient(id)) { | |||
726 | qCWarning(KWIN_CORE) << "Invalid client windowId generated:" << id; | 726 | qCWarning(KWIN_CORE) << "Invalid client windowId generated:" << id; | ||
727 | return 0; | 727 | return 0; | ||
728 | } | 728 | } | ||
729 | return id; | 729 | return id; | ||
730 | } | 730 | } | ||
731 | 731 | | |||
732 | quint16 WaylandServer::createClientId(ClientConnection *c) | 732 | quint16 WaylandServer::createClientId(ClientConnection *c) | ||
733 | { | 733 | { | ||
734 | auto ids = m_clientIds.values().toSet(); | 734 | const QSet<unsigned short> ids(m_clientIds.constBegin(), m_clientIds.constEnd()); | ||
zzag: Unrelated side note: I don't get why Qt folks deprecated toSet(). Range-based initialization… | |||||
apol: I don't get it either. | |||||
735 | quint16 id = 1; | 735 | quint16 id = 1; | ||
736 | if (!ids.isEmpty()) { | 736 | if (!ids.isEmpty()) { | ||
737 | for (quint16 i = ids.count() + 1; i >= 1 ; i--) { | 737 | for (quint16 i = ids.count() + 1; i >= 1 ; i--) { | ||
738 | if (!ids.contains(i)) { | 738 | if (!ids.contains(i)) { | ||
739 | id = i; | 739 | id = i; | ||
740 | break; | 740 | break; | ||
741 | } | 741 | } | ||
742 | } | 742 | } | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |
Unrelated side note: I don't get why Qt folks deprecated toSet(). Range-based initialization looks very clunky if you ask me.