dat: one pair of content purposes
Two frontends read the same two numbers, and wl.c carried four lines of comment to say why it kept its own copy of them. IBus and text-input-v3 number the purposes alike because both took them from GTK, so the header is where they belong and the explanation goes away with the copy. hidden stays in both files: one asks about a context, the other about the seat. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
dat.h
5
dat.h
@@ -29,6 +29,11 @@ enum
|
|||||||
Maxkouho = 128,
|
Maxkouho = 128,
|
||||||
Maxdisp = 9,
|
Maxdisp = 9,
|
||||||
|
|
||||||
|
/* Content purposes whose keys the engine never sees; IBus and
|
||||||
|
* text-input-v3 number them alike, both after GTK. */
|
||||||
|
Purposepassword = 8,
|
||||||
|
Purposepin = 9,
|
||||||
|
|
||||||
Colfg = 0x000000,
|
Colfg = 0x000000,
|
||||||
Colbg = 0xffffff,
|
Colbg = 0xffffff,
|
||||||
Colsep = 0xd0d0d0,
|
Colsep = 0xd0d0d0,
|
||||||
|
|||||||
6
ibus.c
6
ibus.c
@@ -16,8 +16,6 @@ enum
|
|||||||
Relmask = 1<<30,
|
Relmask = 1<<30,
|
||||||
/* IBus wire constants; the daemon does not link libibus. */
|
/* IBus wire constants; the daemon does not link libibus. */
|
||||||
Ibuscappreedit = 1<<0,
|
Ibuscappreedit = 1<<0,
|
||||||
Ibuspurposepassword = 8,
|
|
||||||
Ibuspurposepin = 9,
|
|
||||||
Ibusattrunderline = 1,
|
Ibusattrunderline = 1,
|
||||||
Ibusunderlinesingle = 1,
|
Ibusunderlinesingle = 1,
|
||||||
Ibuspreeditclear = 0,
|
Ibuspreeditclear = 0,
|
||||||
@@ -313,8 +311,8 @@ sendrequest(Ictx *ctx, int op, u32int ks, u32int mod, Keyres *res)
|
|||||||
static int
|
static int
|
||||||
hidden(Ictx *ctx)
|
hidden(Ictx *ctx)
|
||||||
{
|
{
|
||||||
return ctx->purpose == Ibuspurposepassword ||
|
return ctx->purpose == Purposepassword ||
|
||||||
ctx->purpose == Ibuspurposepin;
|
ctx->purpose == Purposepin;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -213,8 +213,8 @@ ibus_private_input_policy(struct ct *t)
|
|||||||
{
|
{
|
||||||
static const struct { u32int purpose; int want; } cases[] = {
|
static const struct { u32int purpose; int want; } cases[] = {
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
{ Ibuspurposepassword, 1 },
|
{ Purposepassword, 1 },
|
||||||
{ Ibuspurposepin, 1 },
|
{ Purposepin, 1 },
|
||||||
{ 37, 0 },
|
{ 37, 0 },
|
||||||
};
|
};
|
||||||
Ibusfix f;
|
Ibusfix f;
|
||||||
@@ -239,7 +239,7 @@ ibus_private_input_policy(struct ct *t)
|
|||||||
contextkey(t, &f, ctx, 'n', Testctrlmask);
|
contextkey(t, &f, ctx, 'n', Testctrlmask);
|
||||||
res = contextkey(t, &f, ctx, 'k', 0);
|
res = contextkey(t, &f, ctx, 'k', 0);
|
||||||
checkstr(t, "preedit", "k", &res.preedit);
|
checkstr(t, "preedit", "k", &res.preedit);
|
||||||
ctx->purpose = Ibuspurposepassword;
|
ctx->purpose = Purposepassword;
|
||||||
memset(&res, 0, sizeof res);
|
memset(&res, 0, sizeof res);
|
||||||
CT_CHECK(t, !processkey(ctx, 'x', 0, text, sizeof text, &res));
|
CT_CHECK(t, !processkey(ctx, 'x', 0, text, sizeof text, &res));
|
||||||
CT_CHECK(t, !res.eaten);
|
CT_CHECK(t, !res.eaten);
|
||||||
|
|||||||
9
wl.c
9
wl.c
@@ -9,16 +9,9 @@
|
|||||||
#include "imv2.h"
|
#include "imv2.h"
|
||||||
#include "vkv1.h"
|
#include "vkv1.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* text-input-v3 content purposes whose keys the engine never sees. IBus
|
|
||||||
* numbers these alike but does not share them: one enum here is cheaper
|
|
||||||
* than reaching into dat.h and ibus.c both.
|
|
||||||
*/
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
Purposepassword = 8,
|
Maxcode = 0x300, /* KEY_MAX+1: what evdev can send */
|
||||||
Purposepin = 9,
|
|
||||||
Maxcode = 0x300, /* KEY_MAX+1: what evdev can send */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user