cleanup: simplify frontend request ownership
This commit is contained in:
5
ibus.c
5
ibus.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user