mirror of
https://github.com/kolunmi/dwlb.git
synced 2025-10-28 10:44:14 +00:00
some minor fixes
This commit is contained in:
parent
f1b1429015
commit
69b3d0ce71
15
dwlb.c
15
dwlb.c
@ -239,7 +239,7 @@ draw_text(char *text,
|
|||||||
if (!*text || !surface_width || xpos >= surface_width)
|
if (!*text || !surface_width || xpos >= surface_width)
|
||||||
return xpos;
|
return xpos;
|
||||||
|
|
||||||
if ((nxpos = xpos + padding) >= surface_width)
|
if ((nxpos = xpos + padding) > surface_width)
|
||||||
return xpos;
|
return xpos;
|
||||||
xpos = nxpos;
|
xpos = nxpos;
|
||||||
|
|
||||||
@ -284,11 +284,8 @@ draw_text(char *text,
|
|||||||
long x_kern = 0;
|
long x_kern = 0;
|
||||||
if (lastcp)
|
if (lastcp)
|
||||||
fcft_kerning(font, lastcp, codepoint, &x_kern, NULL);
|
fcft_kerning(font, lastcp, codepoint, &x_kern, NULL);
|
||||||
if ((nxpos = xpos + x_kern + glyph->advance.x) >= surface_width) {
|
if ((nxpos = xpos + x_kern + glyph->advance.x) > surface_width)
|
||||||
if (!lastcp)
|
|
||||||
return ixpos;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
xpos += x_kern;
|
xpos += x_kern;
|
||||||
lastcp = codepoint;
|
lastcp = codepoint;
|
||||||
|
|
||||||
@ -326,7 +323,7 @@ draw_text(char *text,
|
|||||||
if (state != UTF8_ACCEPT)
|
if (state != UTF8_ACCEPT)
|
||||||
fprintf(stderr, "malformed UTF-8 sequence\n");
|
fprintf(stderr, "malformed UTF-8 sequence\n");
|
||||||
|
|
||||||
nxpos = MIN(xpos + padding, surface_width - 1);
|
nxpos = MIN(xpos + padding, surface_width);
|
||||||
|
|
||||||
if (background && bgcolor)
|
if (background && bgcolor)
|
||||||
pixman_image_fill_boxes(PIXMAN_OP_OVER, background,
|
pixman_image_fill_boxes(PIXMAN_OP_OVER, background,
|
||||||
@ -783,10 +780,8 @@ event_loop(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
client_send_command(struct sockaddr_un *sock_address,
|
client_send_command(struct sockaddr_un *sock_address, const char *output,
|
||||||
const char *output,
|
const char *cmd, const char *data)
|
||||||
const char *cmd,
|
|
||||||
const char *data)
|
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
if (!(dir = opendir(socketdir)))
|
if (!(dir = opendir(socketdir)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user