ibus: keep only the content purpose; nothing read the hints
This commit is contained in:
13
ibus.c
13
ibus.c
@@ -35,7 +35,6 @@ struct Ictx
|
||||
int focused;
|
||||
u32int cap;
|
||||
u32int purpose;
|
||||
u32int hints;
|
||||
int clientcommitpreedit;
|
||||
Caret caret;
|
||||
};
|
||||
@@ -671,11 +670,12 @@ getproperty(DBusMessage *m, const char **iface, const char **name,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ContentType is (purpose, hints); only the purpose matters to us. */
|
||||
static int
|
||||
getcontent(DBusMessageIter *value, u32int *purpose, u32int *hints)
|
||||
getcontent(DBusMessageIter *value, u32int *purpose)
|
||||
{
|
||||
DBusMessageIter st;
|
||||
dbus_uint32_t p, h;
|
||||
dbus_uint32_t p;
|
||||
|
||||
if(dbus_message_iter_get_arg_type(value) != DBUS_TYPE_STRUCT)
|
||||
return 0;
|
||||
@@ -686,11 +686,9 @@ getcontent(DBusMessageIter *value, u32int *purpose, u32int *hints)
|
||||
if(!dbus_message_iter_next(&st) ||
|
||||
dbus_message_iter_get_arg_type(&st) != DBUS_TYPE_UINT32)
|
||||
return 0;
|
||||
dbus_message_iter_get_basic(&st, &h);
|
||||
if(dbus_message_iter_next(&st))
|
||||
return 0;
|
||||
*purpose = p;
|
||||
*hints = h;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -701,7 +699,7 @@ handlepropertyset(DBusConnection *c, DBusMessage *m, Ictx *ctx)
|
||||
const char *iface, *name;
|
||||
DBusMessageIter value, st;
|
||||
dbus_bool_t b;
|
||||
u32int purpose, hints;
|
||||
u32int purpose;
|
||||
Keyres res;
|
||||
int washidden;
|
||||
|
||||
@@ -712,12 +710,11 @@ handlepropertyset(DBusConnection *c, DBusMessage *m, Ictx *ctx)
|
||||
return handleerror(c, m, DBUS_ERROR_UNKNOWN_INTERFACE,
|
||||
"unknown property interface");
|
||||
if(strcmp(name, "ContentType") == 0){
|
||||
if(!getcontent(&value, &purpose, &hints))
|
||||
if(!getcontent(&value, &purpose))
|
||||
return handleerror(c, m, DBUS_ERROR_INVALID_ARGS,
|
||||
"ContentType expects (uu)");
|
||||
washidden = hidden(ctx);
|
||||
ctx->purpose = purpose;
|
||||
ctx->hints = hints;
|
||||
if(ctx->focused && !washidden && hidden(ctx)){
|
||||
sendrequest(ctx, Keyreset, 0, 0, &res);
|
||||
if(clientpreedit(ctx))
|
||||
|
||||
Reference in New Issue
Block a user