]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[fbcon] Always draw cursor using current foreground and background colours
authorMichael Brown <mcb30@ipxe.org>
Sun, 8 Dec 2013 01:28:50 +0000 (01:28 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 9 Dec 2013 15:34:07 +0000 (15:34 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/fbcon.c

index 90786fe0c3fcc6a8327bd3b2ddc46f03c7113985..df287078db779183d83da8672c0b252f9569ee37 100644 (file)
@@ -340,16 +340,14 @@ static void fbcon_scroll ( struct fbcon *fbcon ) {
 static void fbcon_draw_cursor ( struct fbcon *fbcon, int show_cursor ) {
        struct fbcon_text_cell cell;
        size_t offset;
-       uint32_t background;
 
        offset = ( ( ( fbcon->ypos * fbcon->character.width ) + fbcon->xpos ) *
                   sizeof ( cell ) );
        copy_from_user ( &cell, fbcon->text.start, offset, sizeof ( cell ) );
        if ( show_cursor ) {
-               background = cell.background;
-               cell.background = cell.foreground;
-               cell.foreground = ( ( background == FBCON_TRANSPARENT ) ?
-                                   0 : background );
+               cell.background = fbcon->foreground;
+               cell.foreground = ( ( fbcon->background == FBCON_TRANSPARENT ) ?
+                                   0 : fbcon->background );
        }
        fbcon_draw_character ( fbcon, &cell, fbcon->xpos, fbcon->ypos );
 }