Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
53 | #include <KWayland/Server/shadow_interface.h> | 53 | #include <KWayland/Server/shadow_interface.h> | ||
54 | #include <KWayland/Server/subcompositor_interface.h> | 54 | #include <KWayland/Server/subcompositor_interface.h> | ||
55 | #include <KWayland/Server/blur_interface.h> | 55 | #include <KWayland/Server/blur_interface.h> | ||
56 | #include <KWayland/Server/shell_interface.h> | 56 | #include <KWayland/Server/shell_interface.h> | ||
57 | #include <KWayland/Server/outputmanagement_interface.h> | 57 | #include <KWayland/Server/outputmanagement_interface.h> | ||
58 | #include <KWayland/Server/outputconfiguration_interface.h> | 58 | #include <KWayland/Server/outputconfiguration_interface.h> | ||
59 | #include <KWayland/Server/xdgshell_interface.h> | 59 | #include <KWayland/Server/xdgshell_interface.h> | ||
60 | #include <KWayland/Server/xdgforeign_interface.h> | 60 | #include <KWayland/Server/xdgforeign_interface.h> | ||
61 | #include <KWayland/Server/xdgoutput_interface.h> | ||||
62 | | ||||
61 | 63 | | |||
62 | // Qt | 64 | // Qt | ||
63 | #include <QThread> | 65 | #include <QThread> | ||
64 | #include <QWindow> | 66 | #include <QWindow> | ||
65 | 67 | | |||
66 | // system | 68 | // system | ||
67 | #include <sys/types.h> | 69 | #include <sys/types.h> | ||
68 | #include <sys/socket.h> | 70 | #include <sys/socket.h> | ||
▲ Show 20 Lines • Show All 280 Lines • ▼ Show 20 Line(s) | 183 | { | |||
349 | 351 | | |||
350 | m_outputManagement = m_display->createOutputManagement(m_display); | 352 | m_outputManagement = m_display->createOutputManagement(m_display); | ||
351 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | 353 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | ||
352 | this, [this](KWayland::Server::OutputConfigurationInterface *config) { | 354 | this, [this](KWayland::Server::OutputConfigurationInterface *config) { | ||
353 | kwinApp()->platform()->configurationChangeRequested(config); | 355 | kwinApp()->platform()->configurationChangeRequested(config); | ||
354 | }); | 356 | }); | ||
355 | m_outputManagement->create(); | 357 | m_outputManagement->create(); | ||
356 | 358 | | |||
359 | m_xdgOutputManager = m_display->createXdgOutputManager(m_display); | ||||
360 | m_xdgOutputManager->create(); | ||||
361 | | ||||
357 | m_display->createSubCompositor(m_display)->create(); | 362 | m_display->createSubCompositor(m_display)->create(); | ||
358 | 363 | | |||
359 | m_XdgForeign = m_display->createXdgForeignInterface(m_display); | 364 | m_XdgForeign = m_display->createXdgForeignInterface(m_display); | ||
360 | m_XdgForeign->create(); | 365 | m_XdgForeign->create(); | ||
361 | 366 | | |||
362 | return true; | 367 | return true; | ||
363 | } | 368 | } | ||
364 | 369 | | |||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | |||||
448 | } | 453 | } | ||
449 | 454 | | |||
450 | void WaylandServer::syncOutputsToWayland() | 455 | void WaylandServer::syncOutputsToWayland() | ||
451 | { | 456 | { | ||
452 | Screens *s = screens(); | 457 | Screens *s = screens(); | ||
453 | Q_ASSERT(s); | 458 | Q_ASSERT(s); | ||
454 | for (int i = 0; i < s->count(); ++i) { | 459 | for (int i = 0; i < s->count(); ++i) { | ||
455 | OutputInterface *output = m_display->createOutput(m_display); | 460 | OutputInterface *output = m_display->createOutput(m_display); | ||
461 | auto xdgOutput = xdgOutputManager()->createXdgOutput(output, output); | ||||
462 | | ||||
456 | output->setScale(s->scale(i)); | 463 | output->setScale(s->scale(i)); | ||
457 | const QRect &geo = s->geometry(i); | 464 | const QRect &geo = s->geometry(i); | ||
458 | output->setGlobalPosition(geo.topLeft()); | 465 | output->setGlobalPosition(geo.topLeft()); | ||
459 | output->setPhysicalSize(s->physicalSize(i).toSize()); | 466 | output->setPhysicalSize(s->physicalSize(i).toSize()); | ||
460 | output->addMode(geo.size()); | 467 | output->addMode(geo.size()); | ||
468 | | ||||
469 | xdgOutput->setLogicalPosition(geo.topLeft()); | ||||
470 | xdgOutput->setLogicalSize(geo.size()); | ||||
471 | xdgOutput->done(); | ||||
472 | | ||||
461 | output->create(); | 473 | output->create(); | ||
462 | } | 474 | } | ||
463 | } | 475 | } | ||
464 | 476 | | |||
465 | WaylandServer::SocketPairConnection WaylandServer::createConnection() | 477 | WaylandServer::SocketPairConnection WaylandServer::createConnection() | ||
466 | { | 478 | { | ||
467 | SocketPairConnection ret; | 479 | SocketPairConnection ret; | ||
468 | int sx[2]; | 480 | int sx[2]; | ||
▲ Show 20 Lines • Show All 297 Lines • Show Last 20 Lines |