Fix global Power menu key handling, SIP G.711 audio routing, Webarchy audio playback, and ReMEdy Call menu key

This commit is contained in:
Luxferre committed 2026-10-31 19:39:28 +02:00
1 parent d7335b5ebe
commit 0af39d9fa0
76 files changed
+506 -104

No files matched your search

+37
View File
@@ -155,6 +155,30 @@ bool sendPluginFifoMsg(const char* name, const std::string& cmdLine) {
return w == static_cast<ssize_t>(msg.size());
}
bool isCallActiveOrRingingInNeoui() {
if (::access("/tmp/sxmo_call_ringing", F_OK) == 0 ||
::access("/tmp/sxmo_active_call", F_OK) == 0) {
return true;
}
const char* rdir = std::getenv("XDG_RUNTIME_DIR");
std::string base = (rdir && rdir[0]) ? rdir : "/run/user/10000";
if (::access((base + "/sxmo_jobs/ringing").c_str(), F_OK) == 0) {
return true;
}
DIR* d = ::opendir((base + "/sxmo_calls").c_str());
if (d) {
struct dirent* ent;
while ((ent = ::readdir(d)) != nullptr) {
if (ent->d_name[0] != '.' && ent->d_name[0] != '\0') {
::closedir(d);
return true;
}
}
::closedir(d);
}
return false;
}
int mapHardwareKey(KeySym sym, unsigned int keycode, unsigned int state) {
if (keycode == 135 || sym == XK_Super_L || sym == XK_Menu ||
static_cast<uint32_t>(sym) == _EVDEVK(0x8b)) {
@@ -2709,6 +2733,19 @@ int neoui_poll_event(int timeout_ms) {
}
if (ev.type == KeyPress) {
if (sym == XF86XK_PowerOff || kc == 124) {
if (bananarchy::isCallActiveOrRingingInNeoui()) {
bananarchy::sendPluginFifoMsg("callscreen", "HANGUP");
continue;
}
if (::access("/tmp/bananarchy_screen_locked", F_OK) != 0) {
neoui_ungrab();
XFlush(dpy);
bananarchy::sendPluginFifoMsg("dmenu", "OPEN power");
ctx->lastEventType = NEO_EV_CLOSE_REQ;
return NEO_EV_CLOSE_REQ;
}
}
if (ctx->chordXdrawer &&
(nkey == NEO_KEY_SOFT_LEFT || nkey == NEO_KEY_SOFT_RIGHT)) {
int curBit = (nkey == NEO_KEY_SOFT_LEFT) ? 1 : 2;