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

Fix text color when cursor-color is set #1901

Merged
merged 2 commits into from
Sep 27, 2023
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
4 changes: 4 additions & 0 deletions source/widgets/textbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
tb->cursor_x_pos = x + cursor_x;
}
if (tb->blink) {
// This save/restore state is necessary to render the text in the
// correct color when `cursor-color` is set
cairo_save(draw);
// use text color as fallback for themes that don't specify the cursor
// color
rofi_theme_get_color(WIDGET(tb), "cursor-color", draw);
Expand All @@ -555,6 +558,7 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
} else {
cairo_fill(draw);
}
cairo_restore(draw);
}
}

Expand Down