Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect processing of border colours, client.c #308

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,27 +1158,23 @@ setalwaysonbottom(Client *c, uint8_t state)
void
setborderalpha(Client *c, uint8_t alpha)
{
/* remove previous alpha */
const u32 ccol = c->bcol & ~(UINT8_MAX << 24);
const u32 col = ccol + (alpha << 24);
/* TODO */
setbordercolor32(c, col);
c->bcol &= ~(UINT8_MAX << 24);
c->bcol |= alpha << 24;
}

void
setbordercolor(Client *c, uint8_t red, uint8_t green, uint8_t blue)
{
/* get alpha */
const u32 alpha = c->bcol & (UINT8_MAX << 24);

const u32 col = blue + (green << 8) + (red << 16) + alpha;
const u32 col = blue + (green << 8) + (red << 16);
setbordercolor32(c, col);
}

void
setbordercolor32(Client *c, uint32_t col)
{
c->bcol = col & ~(UINT8_MAX << 24);
const u32 mask = (UINT32_MAX ^ (UINT8_MAX << 24));
c->bcol &= mask;
c->bcol |= col & mask;
}

void
Expand Down