Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit dc97376

Browse files
author
Gunnar Andersson
committed
hmicontroller: (PARTIAL) Pass INVALID_ID to auto-generate layer ID
A layer ID of zero is not correct. I am guessing that the previous intention was to use zero to generate an automatic ID, and the ILM documentation incorrectly said that it would (upstream bug [LM-6]). INVALID_ID should be passed instead, to get a generated ID. The parameter to helper function createLayer() must now be passed by reference so that the member variable m_backgroundSurfaceId can be assigned the right value. The layer ID used to be constant (zero) and therefore this was not the case before. [GDP-778] wayland-ivi-extension layer id integration issues from P-0.1 and P-1.0 upgrade [LM-6] Documentation for ilm_layerCreateWithDimension() is wrong regarding creating new ID automatically? Signed-off-by: Gunnar Andersson <gandersson@genivi.org> layercontroller: debug printouts (WIP) Revert "hmicontroller: Pass INVALID_ID to auto-generate layer ID" This reverts commit 4a09142. Redo debug and createlayer-by-ref
1 parent 95aadfb commit dc97376

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

plugins/hmi-controller/layercontroller.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ void LayerController::setLayerVisible(unsigned int layerId)
359359
ilm_commitChanges();
360360
}
361361

362-
bool LayerController::createLayer(unsigned int layerId)
362+
bool LayerController::createLayer(unsigned int &layerId)
363363
{
364364
ilmErrorTypes callResult = ILM_FAILED;
365365
callResult = ilm_layerCreateWithDimension(&layerId, m_screenWidth, m_screenHeight);
@@ -615,7 +615,21 @@ void LayerController::addAppProcess(const AppManager::AppInfo app, const pid_t p
615615
pinfo.surfaceList = {};
616616

617617
// Create layer for new app
618-
createLayer(pid);
618+
619+
// We need a new variable because gcc is picky with having a true lvalue
620+
// for the non-const pass by reference, and not pid which is an rvalue.
621+
// (createLayer will modify the input variable to the layer ID that was
622+
// actually chosen. In this case it should be always what we asked
623+
// for, but it can be dynamic in other cases)
624+
unsigned int layerId = pid;
625+
bool result = createLayer(layerId /*by reference*/);
626+
627+
printf("pid is %d and layerId was set to %d\n",pid, layerId);
628+
printf("createLayer returned result %d\n", (int)result);
629+
630+
// FIXME: This could use an assert(layerId == pid) and also error
631+
// checking (createLayer should return true).
632+
// but this is a quick fix - changing as little as possible.
619633

620634
m_processMap[pid]= pinfo;
621635
}

plugins/hmi-controller/layercontroller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class LayerController : public QObject
6060
void setSurfaceVisible(unsigned int surfaceId);
6161
void setLayerVisible(unsigned int layerId);
6262

63-
bool createLayer(unsigned int layerId);
63+
bool createLayer(unsigned int &layerId);
6464
bool destroyLayer(unsigned int layerId);
6565
void focusOnLayer(unsigned int layerId);
6666

0 commit comments

Comments
 (0)