From cbfecfc4cb26e92602d77674d64115529bbc9685 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Mon, 5 Nov 2018 17:59:21 +0900 Subject: Fix source size 0 sometimes --- src/window_manager.cpp | 6 ++++++ src/wm_layer_control.cpp | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/window_manager.cpp b/src/window_manager.cpp index 31caebf..f209f12 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -227,6 +227,12 @@ result WindowManager::api_request_surface(char const *appid, char const *dr auto id = int(this->id_alloc.generate_id(role)); this->tmp_surface2app[id] = {s_appid, 0}; + // Work Around + HMI_NOTICE("WORK AROUND: add surface on request surface"); + auto client = g_app_list.lookUpClient(s_appid); + client->addSurface(id); + /////////////// + // Set role map of (new, old) this->rolenew2old[role] = string(drawing_name); diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp index 10e99b9..80dc0c9 100644 --- a/src/wm_layer_control.cpp +++ b/src/wm_layer_control.cpp @@ -554,7 +554,19 @@ WMError LayerControl::layoutChange(const WMAction& action) auto rect = this->getAreaSize(action.area); HMI_DEBUG("Set layout %d, %d, %d, %d",rect.x, rect.y, rect.w, rect.h); - ilm_commitChanges(); + + // TO BE FIXED: + // Sometimes, ivi_wm_surface_size signal doesn't reach window manager, + // then, Window Manager can't set source size. + // This fixes it but it takes about 200ns(on R-Car M3) wastefully + ilmSurfaceProperties sp; + ilm_getPropertiesOfSurface(surface, &sp); + if(sp.origSourceHeight != sp.sourceHeight) { + HMI_SEQ_NOTICE(action.req_num, "WORK AROUND: set source size w:%d h%d", sp.origSourceWidth, sp.origSourceHeight); + ilm_surfaceSetSourceRectangle(surface, 0, 0, sp.origSourceWidth, sp.origSourceHeight); + ilm_commitChanges(); + } + ilm_surfaceSetDestinationRectangle(surface, rect.x, rect.y, rect.w, rect.h); ilm_commitChanges(); for(auto &wm_layer: this->wm_layers) -- cgit 1.2.3-korg