From f6ee6341c6265fff5223c900241f8c1a9b41df96 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 25 Aug 2020 12:01:28 +0900 Subject: [PATCH 01/16] DSDisplayArea: remove logs at idle enterer Change-Id: I2bb1ce8e244d8a9022073e6368eaba0dec57f992 --- src/DSDisplayArea/DSDisplayArea.cpp | 9 +++------ src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp | 2 +- src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/DSDisplayArea/DSDisplayArea.cpp b/src/DSDisplayArea/DSDisplayArea.cpp index ecfd519..0fee756 100644 --- a/src/DSDisplayArea/DSDisplayArea.cpp +++ b/src/DSDisplayArea/DSDisplayArea.cpp @@ -166,13 +166,10 @@ void DSDisplayAreaPrivate::__onWindowDestroy(std::shared_ptr window) void DSDisplayAreaPrivate::__onEventIdleEnterer(void *data) { - DSLOG_INF("DSDisplayAreaPrivate", "__onEventIdleEnterer"); + //DSLOG_INF("DSDisplayAreaPrivate", "__onEventIdleEnterer"); - if (!__displayDeviceHWC->commit()) - DSLOG_INF("DSDisplayAreaPrivate", "No commit at this time."); - - if (!__renderEngine->renderFrame()) - DSLOG_INF("DSDisplayAreaPrivate", "No renderFrame at this time."); + __displayDeviceHWC->commit(); + __renderEngine->renderFrame(); } } // namespace display_server diff --git a/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp b/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp index f26f02a..9a3b3a0 100644 --- a/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp +++ b/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp @@ -123,7 +123,7 @@ bool DSDisplayDeviceHWCTDMImpl::commit() uint32_t numChanges; if (!__updateFrameWindows()) { - DSLOG_INF("HWCTDM", "no update windows."); + //DSLOG_INF("HWCTDM", "no update windows."); return false; } diff --git a/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp b/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp index 5377c3b..81b9f5d 100644 --- a/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp +++ b/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp @@ -55,7 +55,7 @@ bool DSDisplayDeviceHWCWindowTDMTargetImpl::updateFrame() std::shared_ptr dsBuffer; if (!__bufferQueue->canAcquireBuffer(false)) { - DSLOG_INF("TDM_HWC", "no acquirable buffer."); + //DSLOG_INF("TDM_HWC", "no acquirable buffer."); return false; } -- 2.7.4 From 68c25f612800bf71ca0bb5f15c6555c87d9713e8 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 25 Aug 2020 13:57:44 +0900 Subject: [PATCH 02/16] DSRenderEngineDaliImpl: Fix a problem with 1 frame latency. Change-Id: I247b77569a247378154bf74b86358abcdf06be52 Signed-off-by: Joonbum Ko --- src/DSRender/DSRenderEngineDaliImpl.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/DSRender/DSRenderEngineDaliImpl.cpp b/src/DSRender/DSRenderEngineDaliImpl.cpp index d18784f..5314d7f 100644 --- a/src/DSRender/DSRenderEngineDaliImpl.cpp +++ b/src/DSRender/DSRenderEngineDaliImpl.cpp @@ -36,7 +36,7 @@ namespace display_server DSRenderEngineDaliImpl::DSRenderEngineDaliImpl(std::shared_ptr bufferQueue) : __bufferQueue(bufferQueue), - __needToRender(true) + __needToRender(false) { tbm_surface_queue_h nativeBufferQueue = (tbm_surface_queue_h)bufferQueue->getNativeBufferQueue(); __offscreenApplication = OffscreenApplication::New(nativeBufferQueue, true, OffscreenApplication::RenderMode::MANUAL); @@ -69,9 +69,6 @@ std::shared_ptr DSRenderEngineDaliImpl::makeRenderView(std::shared bool DSRenderEngineDaliImpl::renderFrame() { if (__needToRender) { - // TODO: do not get the acquired buffer with only one call of Adaptor::Get().RenderOnce(); - // NEED do check it. - Adaptor::Get().RenderOnce(); Adaptor::Get().RenderOnce(); DSLOG_DBG("DSRenderEngineDaliImpl", "RENDER RENDER RENDER~!!!!"); } -- 2.7.4 From 93e84b8eb7b1fff03906772686d5072ffb9637b9 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 25 Aug 2020 13:18:11 +0900 Subject: [PATCH 03/16] DSWindowShell: add code to handle geometry we add code to check DSWindow's allowUserGeometry property before applying geometry Change-Id: Id0bbe05e229eac683b7592f714ce138275697354 --- src/DSWindowShell/DSWindowShell.cpp | 12 +++ src/DSWindowShell/DSWindowShell.h | 4 + src/DSWindowShell/DSWindowShellPrivate.cpp | 141 ++++++++++++++++++++++++++--- src/DSWindowShell/DSWindowShellPrivate.h | 13 ++- src/DSZone/DSZone.cpp | 4 + tests/DSWindowShell-test.cpp | 38 +++++++- 6 files changed, 193 insertions(+), 19 deletions(-) diff --git a/src/DSWindowShell/DSWindowShell.cpp b/src/DSWindowShell/DSWindowShell.cpp index 6863736..8b9a78b 100644 --- a/src/DSWindowShell/DSWindowShell.cpp +++ b/src/DSWindowShell/DSWindowShell.cpp @@ -55,6 +55,18 @@ void DSWindowShell::destroy(void) } +bool DSWindowShell::setZone(DSZone *zone) +{ + DS_GET_PRIV(DSWindowShell); + return priv->setZone(zone); +} + +DSZone *DSWindowShell::getZone(void) +{ + DS_GET_PRIV(DSWindowShell); + return priv->getZone(); +} + void DSWindowShell::setShellSurface(IDSWaylandShellSurface *shellSurface) { DS_GET_PRIV(DSWindowShell); diff --git a/src/DSWindowShell/DSWindowShell.h b/src/DSWindowShell/DSWindowShell.h index f5a76f2..7690094 100644 --- a/src/DSWindowShell/DSWindowShell.h +++ b/src/DSWindowShell/DSWindowShell.h @@ -33,6 +33,7 @@ namespace display_server class DSWindow; class DSWindowShellPrivate; +class DSZone; class DSWindowShell { @@ -47,6 +48,9 @@ public: void destroy(void); + bool setZone(DSZone *zone); + DSZone *getZone(void); + void setShellSurface(IDSWaylandShellSurface *zxdgSurface); IDSWaylandShellSurface *getShellSurface(void); diff --git a/src/DSWindowShell/DSWindowShellPrivate.cpp b/src/DSWindowShell/DSWindowShellPrivate.cpp index 928bee4..f70ebf0 100644 --- a/src/DSWindowShell/DSWindowShellPrivate.cpp +++ b/src/DSWindowShell/DSWindowShellPrivate.cpp @@ -21,6 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include "DSZone.h" #include "DSWindowShell.h" #include "DSWindowShellPrivate.h" @@ -63,6 +64,7 @@ DSWindowShellPrivate::DSWindowShellPrivate(DSWindowShell *p_ptr, DSWindow *windo : __p_ptr(p_ptr), __window(window), __shellSurface(nullptr), + __zone(nullptr), __x(0), __y(0), __w(0), __h(0), __reqX(0), __reqY(0), @@ -155,10 +157,42 @@ void DSWindowShellPrivate::__handleAuxHint(stWindowAuxHint *hint) else set = false; - __window->allowUserGeometry(set); + __handleUserGeometryHint(set); } } +bool DSWindowShellPrivate::__handleUserGeometryHint(bool setUserGeometry) +{ + if (!__window) return false; + + __window->allowUserGeometry(setUserGeometry); + if (setUserGeometry) + { + // reset windows geometry + __x = __y = __w = __h = 0; + __window->setPosition(__x, __y); + __window->setSize(__w, __h); + } + else + { + // apply zone's geometry + if (__zone) + { + stPosition zPos = __zone->getPosition(); + stSize zSize = __zone->getSize(); + __x = zPos.x; + __y = zPos.y; + __w = zSize.w; + __h = zSize.h; + + __window->setPosition(__x, __y); + __window->setSize(__w, __h); + } + } + + return true; +} + bool DSWindowShellPrivate::create(DSWindowShell *pParent) { return true; @@ -186,6 +220,49 @@ void DSWindowShellPrivate::destroy(void) } +bool DSWindowShellPrivate::setZone(DSZone *zone) +{ + if (__zone) + { + // unset information for old zone + } + + __zone = zone; + if (__zone) + { + stPosition zPos = __zone->getPosition(); + stSize zSize = __zone->getSize(); + + // check whether DSWindowShell's geometry has to change or not + if (__window) + { + if (!__window->isAllowUserGeometry()) + { + __x = zPos.x; + __y = zPos.y; + __w = zSize.w; + __h = zSize.h; + + __window->setPosition(__x, __y); + __window->setSize(__w, __h); + } + } + else + { + __x = zPos.x; + __y = zPos.y; + __w = zSize.w; + __h = zSize.h; + } + } + + return true; +} + +DSZone *DSWindowShellPrivate::getZone(void) +{ + return __zone; +} void DSWindowShellPrivate::setShellSurface(IDSWaylandShellSurface *shellSurface) { @@ -247,11 +324,23 @@ bool DSWindowShellPrivate::setSkipFocus(bool set) bool DSWindowShellPrivate::setPosition(int x, int y) { - __x = x; - __y = y; + __reqX = x; + __reqY = y; if (__window) - __window->setPosition(__x, __y); + { + if (__window->isAllowUserGeometry()) + { + __x = x; + __y = y; + __window->setPosition(__x, __y); + } + } + else + { + __x = x; + __y = y; + } return true; } @@ -268,26 +357,52 @@ stPosition DSWindowShellPrivate::getPosition(void) bool DSWindowShellPrivate::setSize(unsigned int w, unsigned int h) { - __w = w; - __h = h; + __reqW = w; + __reqH = h; if (__window) - __window->setSize(__w, __h); + { + if (__window->isAllowUserGeometry()) + { + __w = w; + __h = h; + __window->setSize(__w, __h); + } + } + else + { + __w = w; + __h = h; + } return true; } bool DSWindowShellPrivate::setGeometry(int x, int y, unsigned int w, unsigned int h) { - __x = x; - __y = y; - __w = w; - __h = h; + __reqX = x; + __reqY = y; + __reqW = w; + __reqH = h; if (__window) { - __window->setPosition(__x, __y); - __window->setSize(__w, __h); + if (__window->isAllowUserGeometry()) + { + __x = x; + __y = y; + __w = w; + __h = h; + __window->setPosition(__x, __y); + __window->setSize(__w, __h); + } + } + else + { + __x = x; + __y = y; + __w = w; + __h = h; } return true; diff --git a/src/DSWindowShell/DSWindowShellPrivate.h b/src/DSWindowShell/DSWindowShellPrivate.h index df1e9c8..25e27ae 100644 --- a/src/DSWindowShell/DSWindowShellPrivate.h +++ b/src/DSWindowShell/DSWindowShellPrivate.h @@ -52,6 +52,9 @@ public: void destroy(void); + bool setZone(DSZone *zone); + DSZone *getZone(void); + void setShellSurface(IDSWaylandShellSurface *shellSurface); IDSWaylandShellSurface *getShellSurface(void); @@ -126,14 +129,16 @@ private: struct stWindowAuxHint* __findAuxHint(int32_t id); void __handleAuxHint(stWindowAuxHint *hint); + bool __handleUserGeometryHint(bool setUserGeometry); private: DSWindow *__window; IDSWaylandShellSurface *__shellSurface; - int __x, __y; - unsigned int __w, __h; - int __reqX, __reqY; - unsigned int __reqW, __reqH; + DSZone *__zone; + int __x, __y; // real (applied) position + unsigned int __w, __h; // real (applied) size + int __reqX, __reqY; // requested position by client + unsigned int __reqW, __reqH; // requested size by client DSWindowShell *__parent; int __layer; std::list __childList; diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index 3af703e..c1027be 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -325,6 +325,10 @@ std::shared_ptr DSZone::__createWindowShell(std::shared_ptr shell = std::make_shared(ptrWindow); + if (!shell) return nullptr; + + shell->setZone(this); + __windowShellList.push_front(shell); __windowShellMap.insert(std::make_pair(ptrWindow->surface(), shell.get())); diff --git a/tests/DSWindowShell-test.cpp b/tests/DSWindowShell-test.cpp index 01fba49..0ac8b4d 100644 --- a/tests/DSWindowShell-test.cpp +++ b/tests/DSWindowShell-test.cpp @@ -104,7 +104,23 @@ TEST_F(DSWindowShellTest, getPosition_P1) std::unique_ptr shell = std::make_unique(window.get()); EXPECT_TRUE(shell != nullptr); - EXPECT_TRUE(shell->create(0, 0, 720, 1280, nullptr) == true); + EXPECT_TRUE(shell->setPosition(100, 150) == true); + pos = shell->getPosition(); + + EXPECT_TRUE(pos.x == 0); + EXPECT_TRUE(pos.y == 0); +} + +TEST_F(DSWindowShellTest, getPosition_P2) +{ + stPosition pos; + auto window = std::make_shared(); + std::unique_ptr shell = std::make_unique(window.get()); + EXPECT_TRUE(shell != nullptr); + + // set user geometry + shell->addAuxHint(1, "wm.policy.win.user.geometry", "1"); + EXPECT_TRUE(shell->setPosition(100, 150) == true); pos = shell->getPosition(); @@ -131,7 +147,25 @@ TEST_F(DSWindowShellTest, Geometry_P1) std::unique_ptr shell = std::make_unique(window.get()); EXPECT_TRUE(shell != nullptr); - EXPECT_TRUE(shell->create(0, 0, 720, 1280, nullptr) == true); + shell->setGeometry(100, 150, 480, 800); + geo = shell->getGeometry(); + + EXPECT_TRUE(geo.x == 0); + EXPECT_TRUE(geo.y == 0); + EXPECT_TRUE(geo.w == 0); + EXPECT_TRUE(geo.h == 0); +} + +TEST_F(DSWindowShellTest, Geometry_P2) +{ + stGeometry geo; + + auto window = std::make_shared(); + std::unique_ptr shell = std::make_unique(window.get()); + EXPECT_TRUE(shell != nullptr); + + // set user geometry + shell->addAuxHint(1, "wm.policy.win.user.geometry", "1"); shell->setGeometry(100, 150, 480, 800); geo = shell->getGeometry(); -- 2.7.4 From 393989d84c128ec003cf1de144ef3658c14ee572 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 25 Aug 2020 14:50:18 +0900 Subject: [PATCH 04/16] DSWindowShell: implement raise/lower/activate Change-Id: I97afb6786594587791c37499ed874ee6364794d8 --- src/DSWindowShell/DSWindowShellPrivate.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/DSWindowShell/DSWindowShellPrivate.cpp b/src/DSWindowShell/DSWindowShellPrivate.cpp index f70ebf0..20eeff5 100644 --- a/src/DSWindowShell/DSWindowShellPrivate.cpp +++ b/src/DSWindowShell/DSWindowShellPrivate.cpp @@ -495,12 +495,18 @@ int DSWindowShellPrivate::getLayer(void) bool DSWindowShellPrivate::raise(void) { - return true; + if (__window) + return __window->raise(); + + return false; } bool DSWindowShellPrivate::lower(void) { - return true; + if (__window) + return __window->lower(); + + return false; } bool DSWindowShellPrivate::unsetFocus(void) @@ -527,7 +533,10 @@ bool DSWindowShellPrivate::isFocused(void) bool DSWindowShellPrivate::activate(void) { - return true; + if (__window) + return __window->raiseToTop(); + + return false; } bool DSWindowShellPrivate::isActivated(void) -- 2.7.4 From fa80de055a2cd186eccf44c42b5bc907cd1d8a2f Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 25 Aug 2020 14:38:42 +0900 Subject: [PATCH 05/16] DSZone: send stackChanged Signal when there is a window on the list. Change-Id: I1001aa81c92b4dbc0b2d5041e02fe0450aab46ea --- src/DSZone/DSZone.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index c1027be..3973120 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -304,9 +304,11 @@ void DSZone::__destroyWindow(std::shared_ptr window) __stackChanged = true; __updateWindowOrder(); - std::shared_ptr wTop(__windowList.front()); - wTop->raiseToTop(); - __windowStackChangedSignal.emit(wTop); + if (!__windowList.empty()) { + std::shared_ptr wTop(__windowList.front()); + wTop->raiseToTop(); + __windowStackChangedSignal.emit(wTop); + } } void DSZone::__updateWindowOrder(void) -- 2.7.4 From d74f12b0cb6155dddf71db43c20ca678b3d4086e Mon Sep 17 00:00:00 2001 From: jeon Date: Tue, 25 Aug 2020 16:09:15 +0900 Subject: [PATCH 06/16] DSWaylandServer: set temporary size to BaseOutputResolution Change-Id: I3df77c32564de2e0e8131d33ab75c65e1b998412 --- src/DSWaylandServer/DSWaylandTizenAppinfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp b/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp index 44d5416..8f4a684 100644 --- a/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp +++ b/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp @@ -87,6 +87,9 @@ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_get_base_output_resoluti result = pub->__dsAppinfoMgr->getBaseOutputResolution(pid, &res_w, &res_h); if (!result) { /* TODO: Read configured resolution values */ + /* FIXME : get base resolution from the correct way */ + res_w = 720; + res_h = 1280; } send_base_output_resolution_done(resource->handle, pid, res_w, res_h); DSLOG_DBG("TizenAppinfoPriv", "SEND base_output_resolution_done event with width(%d), height(%d)", res_w, res_h); -- 2.7.4 From 8e815fa90c0586a2110de0f1e4bb4d5e7058c2e1 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 25 Aug 2020 14:38:17 +0900 Subject: [PATCH 07/16] DSRenderViewDaliImpl: Move the emit updatedSignal to setBuffer. - setBuffer is clearer than the __onWindowBufferChanged callback. - This modification is required to properly verify the function of setBuffer in libds-test. Change-Id: I29c565ad5bc4cd19a926d6a8e418325c4ff3bad6 Signed-off-by: Joonbum Ko --- src/DSRender/DSRenderViewDaliImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DSRender/DSRenderViewDaliImpl.cpp b/src/DSRender/DSRenderViewDaliImpl.cpp index 5182934..d1aac16 100644 --- a/src/DSRender/DSRenderViewDaliImpl.cpp +++ b/src/DSRender/DSRenderViewDaliImpl.cpp @@ -139,6 +139,8 @@ bool DSRenderViewDaliImpl::setBuffer(std::shared_ptr buffer) __textureViewActor.SetProperty(Actor::Property::VISIBLE, false); } + __updatedSignal.emit(nullptr); + return true; } @@ -165,8 +167,6 @@ void DSRenderViewDaliImpl::__onWindowBufferChanged(std::shared_ptr bu DSLOG_ERR("DSRenderViewDaliImpl", "setBuffer fails."); return; } - - __updatedSignal.emit(nullptr); } void DSRenderViewDaliImpl::__onWindowRaiseToTopChanged(void *data) -- 2.7.4 From 235ed23cfd02afc85bc194f9ca786c961cc88b3a Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 25 Aug 2020 16:22:11 +0900 Subject: [PATCH 08/16] test: enqueue buffer Change-Id: I410b5f3b1fbab0616ccd20a2e28dc418e1db1484 --- tests/DSDisplayDeviceTDMImpl-test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/DSDisplayDeviceTDMImpl-test.cpp b/tests/DSDisplayDeviceTDMImpl-test.cpp index a366e19..7f9f47c 100644 --- a/tests/DSDisplayDeviceTDMImpl-test.cpp +++ b/tests/DSDisplayDeviceTDMImpl-test.cpp @@ -295,8 +295,7 @@ TEST_F(DSDisplayDeviceTDMImplTest, DeviceHWC_commit) auto buffer = bufferQueue->dequeueBuffer(); EXPECT_TRUE(buffer != nullptr); - - EXPECT_TRUE(deviceHWC->setTargetBuffer(buffer)); + EXPECT_TRUE(bufferQueue->enqueueBuffer(buffer)); // commit EXPECT_TRUE(deviceHWC->commit()); -- 2.7.4 From 53468212c2e2a3afc1e56942c376458502e2a92b Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 25 Aug 2020 15:35:41 +0900 Subject: [PATCH 09/16] DSWindow: send positionChanged signal when window's position is changed Change-Id: Iab9cca37ffcf22c48e9380078c38dca22c616c0d --- src/DSWindow/DSWindow.cpp | 7 +++++++ src/DSWindow/DSWindow.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/DSWindow/DSWindow.cpp b/src/DSWindow/DSWindow.cpp index 41e5288..5854b0d 100644 --- a/src/DSWindow/DSWindow.cpp +++ b/src/DSWindow/DSWindow.cpp @@ -391,6 +391,8 @@ void DSWindow::setPosition(int x, int y) priv->__y = y; priv->__changedGeometry = true; + + __windowPositionChangedSignal.emit(nullptr); } stPosition DSWindow::getPosition(void) @@ -503,4 +505,9 @@ void DSWindow::registerCallbackWindowRaiseToTop(DSObject *slot, std::function func) +{ + __windowPositionChangedSignal.connect(slot, func); +} + } // namespace display_server diff --git a/src/DSWindow/DSWindow.h b/src/DSWindow/DSWindow.h index 21ef2b0..627065e 100644 --- a/src/DSWindow/DSWindow.h +++ b/src/DSWindow/DSWindow.h @@ -96,6 +96,7 @@ public: void registerCallbackBufferChanged(DSObject *slot, std::function)> func); void registerCallbackWindowDestroyed(DSObject *slot, std::function func); void registerCallbackWindowRaiseToTop(DSObject *slot, std::function func); + void registerCallbackWindowPositionChanged(DSObject *slot, std::function func); protected: //virtual bool _onFocus(void); @@ -107,6 +108,7 @@ private: DSSignal> __bufferChangedSignal; DSSignal __windowDestroySignal; DSSignal __windowRaiseToTopSignal; + DSSignal __windowPositionChangedSignal; }; } -- 2.7.4 From 9f69b1204869a602c66ae5f6b51da730e207281b Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 25 Aug 2020 16:57:52 +0900 Subject: [PATCH 10/16] DSZone: donot check if window list is empty when zone sends stackChanged signal. Change-Id: Iabadf761ef4fdc4b9ad8bbf8771f4921e16aff95 --- src/DSZone/DSZone.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index 3973120..6c9a31e 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -235,8 +235,9 @@ void DSZone::__prependWindowList(std::shared_ptr window) __updateWindowOrder(); std::shared_ptr wTop(__windowList.front()); - wTop->raiseToTop(); __windowStackChangedSignal.emit(wTop); + + wTop->raiseToTop(); } void DSZone::__appendWindowList(std::shared_ptr window) @@ -248,8 +249,9 @@ void DSZone::__appendWindowList(std::shared_ptr window) __updateWindowOrder(); std::shared_ptr wTop(__windowList.front()); - wTop->raiseToTop(); __windowStackChangedSignal.emit(wTop); + + wTop->raiseToTop(); } std::shared_ptr DSZone::__findWindow(DSWaylandSurface *dswlSurface) @@ -304,11 +306,11 @@ void DSZone::__destroyWindow(std::shared_ptr window) __stackChanged = true; __updateWindowOrder(); - if (!__windowList.empty()) { - std::shared_ptr wTop(__windowList.front()); + std::shared_ptr wTop(__windowList.front()); + __windowStackChangedSignal.emit(wTop); + + if (!__windowList.empty()) wTop->raiseToTop(); - __windowStackChangedSignal.emit(wTop); - } } void DSZone::__updateWindowOrder(void) -- 2.7.4 From 82d887f55f117a83c1b2f24499e4096d9161c3c0 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Tue, 25 Aug 2020 18:58:32 +0900 Subject: [PATCH 11/16] DSDisplayDeviceHWCWindowTDMTargetImpl: set target buffer in updateFrame Change-Id: I744ec61de0f180f8d11ce2e34aa645525661ab2e --- src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp b/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp index 81b9f5d..abc3893 100644 --- a/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp +++ b/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp @@ -70,7 +70,8 @@ bool DSDisplayDeviceHWCWindowTDMTargetImpl::updateFrame() __buffer = nullptr; } - __buffer= dsBuffer; + __buffer = dsBuffer; + __deviceHWC->setTargetBuffer(__buffer); return true; } @@ -79,7 +80,6 @@ void DSDisplayDeviceHWCWindowTDMTargetImpl::presentFrame() { if (__buffer) { __presentBuffer = std::move(__buffer); - __deviceHWC->setTargetBuffer(__presentBuffer); } } -- 2.7.4 From 73a7e7580b70d69770c7101dd35a46edce1e985c Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 25 Aug 2020 18:35:58 +0900 Subject: [PATCH 12/16] DSWaylandSurface: add getClient() Change-Id: I625fe50c72cb2224fb2d2a7712075c0f69a4b6a0 Signed-off-by: Sung-Jin Park --- src/DSWaylandServer/DSWaylandSurface.cpp | 10 ++++++++++ src/DSWaylandServer/DSWaylandSurface.h | 1 + src/DSWaylandServer/DSWaylandSurfacePrivate.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/DSWaylandServer/DSWaylandSurface.cpp b/src/DSWaylandServer/DSWaylandSurface.cpp index 26afa18..4d4ce31 100644 --- a/src/DSWaylandServer/DSWaylandSurface.cpp +++ b/src/DSWaylandServer/DSWaylandSurface.cpp @@ -23,6 +23,7 @@ #include "DSWaylandSurface.h" #include "DSWaylandSurfacePrivate.h" +#include "DSWaylandClient.h" namespace display_server { @@ -77,6 +78,7 @@ DSWaylandSurfacePrivate::DSWaylandSurfacePrivate(DSWaylandSurface *p_ptr) __p_ptr(p_ptr), __commitInfoPending{std::make_unique()}, __commitInfo{std::make_shared()}, + __waylandClient(nullptr), __bufferManager{DSBufferManager::getInstance()}, __resId(0) {} @@ -86,6 +88,7 @@ DSWaylandSurfacePrivate::DSWaylandSurfacePrivate(DSWaylandSurface *p_ptr, DSWayl __p_ptr(p_ptr), __commitInfoPending{std::make_unique()}, __commitInfo{std::make_shared()}, + __waylandClient(waylandClient), __bufferManager{DSBufferManager::getInstance()}, __resId(0) { @@ -242,6 +245,13 @@ struct ::wl_resource *DSWaylandSurface::getWlResource() return priv->resource()->handle; } +DSWaylandClient *DSWaylandSurface::getClient() +{ + DS_GET_PRIV(DSWaylandSurface); + + return priv->__waylandClient; +} + bool DSWaylandSurface::hasResource() { DS_GET_PRIV(DSWaylandSurface); diff --git a/src/DSWaylandServer/DSWaylandSurface.h b/src/DSWaylandServer/DSWaylandSurface.h index d9cac4a..f6cf2ca 100644 --- a/src/DSWaylandServer/DSWaylandSurface.h +++ b/src/DSWaylandServer/DSWaylandSurface.h @@ -64,6 +64,7 @@ public: void registerCallbackSurfaceCommitted(DSObject *slot, std::function commitInfo)> func); struct ::wl_resource *getWlResource(); + DSWaylandClient *getClient(); bool hasResource(); uint32_t getResourceId(); diff --git a/src/DSWaylandServer/DSWaylandSurfacePrivate.h b/src/DSWaylandServer/DSWaylandSurfacePrivate.h index 4b37613..0ed0577 100644 --- a/src/DSWaylandServer/DSWaylandSurfacePrivate.h +++ b/src/DSWaylandServer/DSWaylandSurfacePrivate.h @@ -111,6 +111,7 @@ protected: private: std::unique_ptr __commitInfoPending; std::shared_ptr __commitInfo; + DSWaylandClient *__waylandClient; DSBufferManager *__bufferManager; uint32_t __resId; }; -- 2.7.4 From 500c21a70b4b72fb2c090a8dc60341c6f9048106 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 25 Aug 2020 18:36:54 +0900 Subject: [PATCH 13/16] DSWaylandKeyboard: sendEnter when the focused client get wl_keyboard Change-Id: I2f36a87bfbe34bda11ed91b0c197de958f09c11e Signed-off-by: Sung-Jin Park --- src/DSWaylandServer/DSWaylandKeyboard.cpp | 17 ++++++++++++++++- src/DSWaylandServer/DSWaylandKeyboardPrivate.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/DSWaylandServer/DSWaylandKeyboard.cpp b/src/DSWaylandServer/DSWaylandKeyboard.cpp index 3ca2388..8002088 100644 --- a/src/DSWaylandServer/DSWaylandKeyboard.cpp +++ b/src/DSWaylandServer/DSWaylandKeyboard.cpp @@ -211,6 +211,21 @@ void DSWaylandKeyboardPrivate::sendKey(uint32_t key, uint32_t state) std::for_each(resMap.begin(), resMap.end(), func); } +void DSWaylandKeyboardPrivate::__addClient(struct ::wl_client *wlClient, uint32_t id, int version) +{ + wl_keyboard::add(wlClient, id, version); + + if (__focusSurface && __focusSurface->hasResource()) + { + DSWaylandClient *waylandClient = __focusSurface->getClient(); + if (waylandClient && (waylandClient->wlClient() == wlClient)) + { + DSLOG_INF("DSWaylandKeyboardPrivate", "Send enter to focusSurface(%p)", __focusSurface); + sendEnter(__focusSurface->getWlResource()); + } + } +} + /* Begin Public Class Implementation */ DSWaylandKeyboard::DSWaylandKeyboard(DSWaylandSeat *seat) : DSObject(), _d_ptr(std::make_unique(seat, this)) @@ -264,7 +279,7 @@ void DSWaylandKeyboard::addClient(DSWaylandClient *client, uint32_t id, int vers DSLOG_INF("DSWaylandKeyboard", "addClient(dswlClient=%p, id=%u, version=%d", client, id, version); - priv->add(client->wlClient(), id, version); + priv->__addClient(client->wlClient(), id, version); } void DSWaylandKeyboard::setFocus(DSWaylandSurface *waylandSurface) diff --git a/src/DSWaylandServer/DSWaylandKeyboardPrivate.h b/src/DSWaylandServer/DSWaylandKeyboardPrivate.h index f3be21d..48f4665 100644 --- a/src/DSWaylandServer/DSWaylandKeyboardPrivate.h +++ b/src/DSWaylandServer/DSWaylandKeyboardPrivate.h @@ -64,6 +64,8 @@ protected: void sendModifiers(struct ::wl_resource *surface); private: + void __addClient(struct ::wl_client *wlClient, uint32_t id, int version); + DSWaylandSeat *__seat; DSXkb *__xkb; DSWaylandCompositor *__compositor; -- 2.7.4 From 664ca00454b4b7249507d836c2b741426a1aa40c Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 25 Aug 2020 18:01:57 +0900 Subject: [PATCH 14/16] DSWindow: make lowerToBottom method and registerCallback method of it. Change-Id: I414fb66abe5510e0116f48d50a233f2086618677 Signed-off-by: Joonbum Ko --- src/DSWindow/DSWindow.cpp | 12 ++++++++++++ src/DSWindow/DSWindow.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/DSWindow/DSWindow.cpp b/src/DSWindow/DSWindow.cpp index 5854b0d..abf824d 100644 --- a/src/DSWindow/DSWindow.cpp +++ b/src/DSWindow/DSWindow.cpp @@ -362,6 +362,13 @@ bool DSWindow::raiseToTop() return true; } +bool DSWindow::lowerToBottom() +{ + __windowLowerToBottomSignal.emit(nullptr); + + return true; +} + bool DSWindow::unsetFocus(void) { DS_GET_PRIV(DSWindow); @@ -505,6 +512,11 @@ void DSWindow::registerCallbackWindowRaiseToTop(DSObject *slot, std::function func) +{ + __windowLowerToBottomSignal.connect(slot, func); +} + void DSWindow::registerCallbackWindowPositionChanged(DSObject *slot, std::function func) { __windowPositionChangedSignal.connect(slot, func); diff --git a/src/DSWindow/DSWindow.h b/src/DSWindow/DSWindow.h index 627065e..ebdf453 100644 --- a/src/DSWindow/DSWindow.h +++ b/src/DSWindow/DSWindow.h @@ -69,6 +69,7 @@ public: bool raise(void); bool lower(void); bool raiseToTop(); + bool lowerToBottom(); bool unsetFocus(void); bool setFocus(void); @@ -96,6 +97,7 @@ public: void registerCallbackBufferChanged(DSObject *slot, std::function)> func); void registerCallbackWindowDestroyed(DSObject *slot, std::function func); void registerCallbackWindowRaiseToTop(DSObject *slot, std::function func); + void registerCallbackWindowLowerToBottom(DSObject *slot, std::function func); void registerCallbackWindowPositionChanged(DSObject *slot, std::function func); protected: @@ -108,6 +110,7 @@ private: DSSignal> __bufferChangedSignal; DSSignal __windowDestroySignal; DSSignal __windowRaiseToTopSignal; + DSSignal __windowLowerToBottomSignal; DSSignal __windowPositionChangedSignal; }; -- 2.7.4 From 42e6ac7ca9662e79589ece248874bffa243dd7e8 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 25 Aug 2020 18:05:17 +0900 Subject: [PATCH 15/16] DSRenderViewDaliImpl: register lowerToBottom callback of window Change-Id: I9dabc8630aa33e137726304053eb61ff36d4deb5 Signed-off-by: Joonbum Ko --- src/DSRender/DSRenderViewDaliImpl.cpp | 11 +++++++++++ src/DSRender/DSRenderViewDaliImpl.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/DSRender/DSRenderViewDaliImpl.cpp b/src/DSRender/DSRenderViewDaliImpl.cpp index d1aac16..a004670 100644 --- a/src/DSRender/DSRenderViewDaliImpl.cpp +++ b/src/DSRender/DSRenderViewDaliImpl.cpp @@ -106,6 +106,7 @@ DSRenderViewDaliImpl::DSRenderViewDaliImpl(std::shared_ptr window, Dal // callbacks window->registerCallbackBufferChanged(this, std::bind(&DSRenderViewDaliImpl::__onWindowBufferChanged, this, std::placeholders::_1)); window->registerCallbackWindowRaiseToTop(this, std::bind(&DSRenderViewDaliImpl::__onWindowRaiseToTopChanged, this, std::placeholders::_1)); + window->registerCallbackWindowLowerToBottom(this, std::bind(&DSRenderViewDaliImpl::__onWindowLowerToBottomChanged, this, std::placeholders::_1)); } DSRenderViewDaliImpl::~DSRenderViewDaliImpl() @@ -179,4 +180,14 @@ void DSRenderViewDaliImpl::__onWindowRaiseToTopChanged(void *data) __updatedSignal.emit(nullptr); } +void DSRenderViewDaliImpl::__onWindowLowerToBottomChanged(void *data) +{ + DSLOG_INF("DSRenderViewDaliImpl", "__onWindowLowerToBottomChanged."); + + __textureViewActor.SetProperty(Actor::Property::VISIBLE, true); + __textureViewActor.LowerToBottom(); + + __updatedSignal.emit(nullptr); +} + } // namespace display_server diff --git a/src/DSRender/DSRenderViewDaliImpl.h b/src/DSRender/DSRenderViewDaliImpl.h index d6fe3f6..5048555 100644 --- a/src/DSRender/DSRenderViewDaliImpl.h +++ b/src/DSRender/DSRenderViewDaliImpl.h @@ -50,6 +50,7 @@ public: private: void __onWindowBufferChanged(std::shared_ptr buffer); void __onWindowRaiseToTopChanged(void *data); + void __onWindowLowerToBottomChanged(void *data); std::shared_ptr __window; Dali::OffscreenWindow __offscreenWindow; -- 2.7.4 From abd81817db1a999bb899177be3aa5652954868ff Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 25 Aug 2020 18:29:31 +0900 Subject: [PATCH 16/16] DSRenderViewDaliImpl: register positionChanged callback of window Change-Id: I7d816751ae28b999f68bb0edb6da1907a8d38049 Signed-off-by: Joonbum Ko --- src/DSRender/DSRenderViewDaliImpl.cpp | 13 +++++++++++++ src/DSRender/DSRenderViewDaliImpl.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/DSRender/DSRenderViewDaliImpl.cpp b/src/DSRender/DSRenderViewDaliImpl.cpp index a004670..7cc724d 100644 --- a/src/DSRender/DSRenderViewDaliImpl.cpp +++ b/src/DSRender/DSRenderViewDaliImpl.cpp @@ -107,6 +107,7 @@ DSRenderViewDaliImpl::DSRenderViewDaliImpl(std::shared_ptr window, Dal window->registerCallbackBufferChanged(this, std::bind(&DSRenderViewDaliImpl::__onWindowBufferChanged, this, std::placeholders::_1)); window->registerCallbackWindowRaiseToTop(this, std::bind(&DSRenderViewDaliImpl::__onWindowRaiseToTopChanged, this, std::placeholders::_1)); window->registerCallbackWindowLowerToBottom(this, std::bind(&DSRenderViewDaliImpl::__onWindowLowerToBottomChanged, this, std::placeholders::_1)); + window->registerCallbackWindowPositionChanged(this, std::bind(&DSRenderViewDaliImpl::__onWindowPositionChanged, this, std::placeholders::_1)); } DSRenderViewDaliImpl::~DSRenderViewDaliImpl() @@ -190,4 +191,16 @@ void DSRenderViewDaliImpl::__onWindowLowerToBottomChanged(void *data) __updatedSignal.emit(nullptr); } +void DSRenderViewDaliImpl::__onWindowPositionChanged(void *data) +{ + DSLOG_INF("DSRenderViewDaliImpl", "__onWindowPositionChanged."); + + stPosition pos = __window->getPosition(); + + __textureViewActor.SetProperty(Actor::Property::VISIBLE, true); + __textureViewActor.SetProperty(Actor::Property::POSITION, Vector3( pos.x, pos.y, 0.0f )); + + __updatedSignal.emit(nullptr); +} + } // namespace display_server diff --git a/src/DSRender/DSRenderViewDaliImpl.h b/src/DSRender/DSRenderViewDaliImpl.h index 5048555..8ffd858 100644 --- a/src/DSRender/DSRenderViewDaliImpl.h +++ b/src/DSRender/DSRenderViewDaliImpl.h @@ -51,6 +51,7 @@ private: void __onWindowBufferChanged(std::shared_ptr buffer); void __onWindowRaiseToTopChanged(void *data); void __onWindowLowerToBottomChanged(void *data); + void __onWindowPositionChanged(void *data); std::shared_ptr __window; Dali::OffscreenWindow __offscreenWindow; -- 2.7.4