cleanup: simplify frontend request ownership

This commit is contained in:
2026-08-13 21:57:32 +09:00
parent 13f0b436b8
commit b6a9ccd9d9
9 changed files with 74 additions and 79 deletions

5
ibus.c
View File

@@ -30,7 +30,6 @@ struct Ictx
{
DBusConnection *conn;
char path[64];
uvlong owner;
int focused;
Caret caret;
};
@@ -282,7 +281,6 @@ newcontext(DBusConnection *conn, const char *path)
if(contexts[i].conn == nil){
memset(&contexts[i], 0, sizeof contexts[i]);
contexts[i].conn = conn;
contexts[i].owner = ownernew();
strncpy(contexts[i].path, path, sizeof contexts[i].path);
contexts[i].path[sizeof contexts[i].path-1] = '\0';
return &contexts[i];
@@ -296,12 +294,11 @@ sendrequest(Ictx *ctx, int op, u32int ks, u32int mod, Keyres *res)
Keyreq kr;
memset(&kr, 0, sizeof kr);
kr.owner = ctx->owner;
kr.owner = ctx;
kr.op = op;
kr.ks = ks;
kr.mod = mod;
kr.caret = ctx->caret;
kr.want = op == Keypress;
kr.reply = replyc;
chansend(keyc, &kr);
chanrecv(replyc, res);