fix(popup): fit the current X11 monitor

This commit is contained in:
2026-08-14 22:54:15 +09:00
parent 59482d00f3
commit 38475318db
8 changed files with 505 additions and 115 deletions

12
dat.h
View File

@@ -22,6 +22,7 @@ enum
PopupSep = 1,
PopupNumw = Fontsz,
PopupTextw = 12*Fontsz,
PopupBasew = 2*PopupPad + PopupNumw + PopupTextw,
Maxrunes = 64,
Maxutf = Maxrunes * UTFmax + 1,
};
@@ -31,7 +32,6 @@ enum
Maxclients = 64,
Maxkouho = 32,
Maxdisp = 9,
Imgw = 2*PopupPad + PopupNumw + PopupTextw,
Imgh = 2*PopupPad + (Maxdisp + 2)*Fontsz + PopupSep,
Colfg = 0x000000,
@@ -124,6 +124,15 @@ struct Im
typedef struct Drawcmd Drawcmd;
typedef struct Caret Caret;
typedef struct Area Area;
struct Area
{
int x;
int y;
int w;
int h;
};
struct Caret
{
int valid;
@@ -149,6 +158,7 @@ struct Popup
int w;
int h;
int n;
int row0;
int prey;
int sepy;
int rowsy;