Skip to content

Commit

Permalink
Merge pull request #351 from webOS-ports/herrie/fix-appid
Browse files Browse the repository at this point in the history
AppMenu.qml: Make sure to set the correct title of the app.
  • Loading branch information
Tofee authored Nov 22, 2023
2 parents 7e67c8f + 61b8153 commit b6f8050
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions qml/StatusBar/AppMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Item {
// now, if the appId is valid, fetch the app name
if (activeWindowAppId.length > 0) {
service.call("luna://com.webos.service.applicationManager/getAppInfo",
JSON.stringify({"appId":activeWindowAppId}),
JSON.stringify({"id":activeWindowAppId}),
handleGetAppInfoResponse, handleGetAppInfoError);
}
else
Expand All @@ -55,10 +55,11 @@ Item {

function determineActiveWindowAppId() {
var appId = "";
if (launcherInstance.state === "justTypeLauncher")
if (launcherInstance.state === "justTypeLauncher") {
appId = "com.palm.launcher";
else
appId = cardViewInstance.getAppIdForFocusApplication();
} else {
appId = cardViewInstance.getAppIdForFocusApplication();
}
return appId;
}

Expand All @@ -77,10 +78,11 @@ Item {

function handleGetAppInfoResponse(message) {
var response = JSON.parse(message.payload);
if (response.returnValue && response.appInfo && response.appInfo.appmenu)
activeWindowTitle = response.appInfo.appmenu;
else
if (response.returnValue && response.appInfo && (response.appInfo.appmenu || response.appInfo.title)) {
activeWindowTitle = response.appInfo.appmenu ? response.appInfo.appmenu : response.appInfo.title;
} else {
activeWindowTitle = defaultAppMenuTitle;
}
}

function handleGetAppInfoError(error) {
Expand Down

0 comments on commit b6f8050

Please sign in to comment.