mirror of https://github.com/ipxe/ipxe.git
[fbcon] Always draw cursor using current foreground and background colours
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/17/head
parent
153748cce9
commit
4c51f9602d
|
@ -340,16 +340,14 @@ static void fbcon_scroll ( struct fbcon *fbcon ) {
|
||||||
static void fbcon_draw_cursor ( struct fbcon *fbcon, int show_cursor ) {
|
static void fbcon_draw_cursor ( struct fbcon *fbcon, int show_cursor ) {
|
||||||
struct fbcon_text_cell cell;
|
struct fbcon_text_cell cell;
|
||||||
size_t offset;
|
size_t offset;
|
||||||
uint32_t background;
|
|
||||||
|
|
||||||
offset = ( ( ( fbcon->ypos * fbcon->character.width ) + fbcon->xpos ) *
|
offset = ( ( ( fbcon->ypos * fbcon->character.width ) + fbcon->xpos ) *
|
||||||
sizeof ( cell ) );
|
sizeof ( cell ) );
|
||||||
copy_from_user ( &cell, fbcon->text.start, offset, sizeof ( cell ) );
|
copy_from_user ( &cell, fbcon->text.start, offset, sizeof ( cell ) );
|
||||||
if ( show_cursor ) {
|
if ( show_cursor ) {
|
||||||
background = cell.background;
|
cell.background = fbcon->foreground;
|
||||||
cell.background = cell.foreground;
|
cell.foreground = ( ( fbcon->background == FBCON_TRANSPARENT ) ?
|
||||||
cell.foreground = ( ( background == FBCON_TRANSPARENT ) ?
|
0 : fbcon->background );
|
||||||
0 : background );
|
|
||||||
}
|
}
|
||||||
fbcon_draw_character ( fbcon, &cell, fbcon->xpos, fbcon->ypos );
|
fbcon_draw_character ( fbcon, &cell, fbcon->xpos, fbcon->ypos );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue