From 3eb5151af9b94b9820b66a871eac127a1c00fc68 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Sun, 9 Aug 2020 13:33:20 +0900 Subject: [PATCH] DSOutput: create DSWaylandOutput object after IDSDisplayDeviceOutput sets the mode. Change-Id: I742344d68185a87ea5b88cde483e17cb9149e408 --- src/DSOutput/DSOutputImpl.cpp | 19 ++++++++++++++----- src/DSOutput/DSOutputImpl.h | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/DSOutput/DSOutputImpl.cpp b/src/DSOutput/DSOutputImpl.cpp index b51dbd4..60dfbd8 100644 --- a/src/DSOutput/DSOutputImpl.cpp +++ b/src/DSOutput/DSOutputImpl.cpp @@ -5,9 +5,7 @@ namespace display_server { DSOutputImpl::DSOutputImpl(std::shared_ptr displayDeviceOutput) - : __resolutionWidth{0}, - __resolutionHeight{0}, - __displayDeviceOutput{displayDeviceOutput} + : __displayDeviceOutput{displayDeviceOutput} {} DSOutputImpl::~DSOutputImpl() @@ -15,12 +13,12 @@ DSOutputImpl::~DSOutputImpl() int DSOutputImpl::getResolutionWidth() { - return __resolutionWidth; + return __displayDeviceOutput->getResolutionWidth(); } int DSOutputImpl::getResolutionHeight() { - return __resolutionHeight; + return __displayDeviceOutput->getResolutionHeight(); } bool DSOutputImpl::applyResolutionAuto() @@ -47,6 +45,17 @@ bool DSOutputImpl::applyResolutionAuto() return false; } + // TODO: get more information from DSOutputImpl to set them toDSWaylandOutput. + __waylandOutput = std::make_shared(DSWaylandCompositor::getInstance(), + __displayDeviceOutput->getName(), "tm1", "tm1", + 0, 0, __displayDeviceOutput->getResolutionWidth(), __displayDeviceOutput->getResolutionHeight(), + __displayDeviceOutput->getPhysicalMMWidth(), __displayDeviceOutput->getPhysicalMMHeight(), + __displayDeviceOutput->getRefreshRate(), 0, 0); + DSWaylandCompositor::releaseInstance(); + + // send output information + __waylandOutput->sendWaylandOutputInfo(); + return true; } diff --git a/src/DSOutput/DSOutputImpl.h b/src/DSOutput/DSOutputImpl.h index de0eb85..528ce63 100644 --- a/src/DSOutput/DSOutputImpl.h +++ b/src/DSOutput/DSOutputImpl.h @@ -3,6 +3,7 @@ #include "IDSOutput.h" #include "IDSDisplayDeviceOutput.h" +#include "DSWaylandOutput.h" namespace display_server { @@ -20,9 +21,8 @@ public: std::shared_ptr getDisplayDeviceOutput(); private: - int __resolutionWidth; - int __resolutionHeight; std::shared_ptr __displayDeviceOutput; + std::shared_ptr __waylandOutput; }; } -- 2.7.4