Skip to content

Commit

Permalink
mangoapp: Add extra elements
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Jun 22, 2024
1 parent ddc5a82 commit 7cf3571
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mangoapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
#include <cstring>

#include "steamcompmgr.hpp"
#include "refresh_rate.h"
#include "main.hpp"

static bool inited = false;
static int msgid = 0;
extern bool g_bAppWantsHDRCached;
extern uint32_t g_focusedBaseAppId;

struct mangoapp_msg_header {
long msg_type; // Message queue ID, never change
Expand All @@ -25,6 +28,10 @@ struct mangoapp_msg_v1 {
uint64_t latency_ns;
uint32_t outputWidth;
uint32_t outputHeight;
uint16_t displayRefresh;
bool bAppWantsHDR : 1;
bool bSteamFocused : 1;

// WARNING: Always ADD fields, never remove or repurpose fields
} __attribute__((packed)) mangoapp_msg_v1;

Expand All @@ -50,6 +57,9 @@ void mangoapp_update( uint64_t visible_frametime, uint64_t app_frametime_ns, uin
mangoapp_msg_v1.pid = focusWindow_pid;
mangoapp_msg_v1.outputWidth = g_nOutputWidth;
mangoapp_msg_v1.outputHeight = g_nOutputHeight;
mangoapp_msg_v1.displayRefresh = (uint16_t) gamescope::ConvertmHzToHz( g_nOutputRefresh );
mangoapp_msg_v1.bAppWantsHDR = g_bAppWantsHDRCached;
mangoapp_msg_v1.bSteamFocused = g_focusedBaseAppId == 769;
msgsnd(msgid, &mangoapp_msg_v1, sizeof(mangoapp_msg_v1) - sizeof(mangoapp_msg_v1.hdr.msg_type), IPC_NOWAIT);
}

Expand Down

0 comments on commit 7cf3571

Please sign in to comment.