fix: harden caret and IBus dispatch

This commit is contained in:
2026-08-12 17:34:34 +09:00
parent de536da0bb
commit 4e90fdd5c7
5 changed files with 21 additions and 12 deletions

View File

@@ -249,7 +249,6 @@ engine_active_owner_caret(struct ct *t)
a.valid = 1;
a.x = 10;
a.y = 20;
a.w = 3;
a.h = 14;
moved = a;
moved.x = 80;
@@ -1221,7 +1220,6 @@ engine_randomized_stress(struct ct *t)
pos.valid = (rnd >> 25) & 1;
pos.x = (rnd >> 3) & 0x3ff;
pos.y = (rnd >> 13) & 0x3ff;
pos.w = 1 + ((rnd >> 23) & 0x1f);
pos.h = 1 + ((rnd >> 18) & 0x1f);
if(op < 13)
res = ownerrequestat(owner, Keypress,

View File

@@ -1,4 +1,5 @@
#include "test.h"
#include <limits.h>
void
popup_layout(struct ct *t)
@@ -24,4 +25,10 @@ popup_layout(struct ct *t)
popupposition(&caret, 0, 0, 800, 600, 100, 60, &x, &y);
CT_EQ_INT(t, 700, x);
CT_EQ_INT(t, 540, y);
caret.x = INT_MIN;
caret.y = INT_MAX;
caret.h = INT_MAX;
popupposition(&caret, 0, 0, 800, 600, 100, 60, &x, &y);
CT_EQ_INT(t, 0, x);
CT_EQ_INT(t, 540, y);
}