Hide cursor if in notification bar, and soft reset on exit

This commit is contained in:
Keith Winstein
2011-10-13 00:17:05 -04:00
parent 197bbb5272
commit 07173590c9
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ int main( int argc, char *argv[] )
client.main(); client.main();
client.shutdown(); client.shutdown();
printf( "\n[stm is exiting.]\n" ); printf( "\033[!p\n[stm is exiting.]\n" );
return 0; return 0;
} }
+7
View File
@@ -219,6 +219,8 @@ void NotificationEngine::apply( Framebuffer &fb ) const
assert( fb.ds.get_width() > 0 ); assert( fb.ds.get_width() > 0 );
assert( fb.ds.get_height() > 0 ); assert( fb.ds.get_height() > 0 );
/* draw bar across top of screen */
Cell notification_bar( 0 ); Cell notification_bar( 0 );
notification_bar.renditions.foreground_color = 37; notification_bar.renditions.foreground_color = 37;
notification_bar.renditions.background_color = 44; notification_bar.renditions.background_color = 44;
@@ -228,6 +230,11 @@ void NotificationEngine::apply( Framebuffer &fb ) const
*(fb.get_mutable_cell( 0, i )) = notification_bar; *(fb.get_mutable_cell( 0, i )) = notification_bar;
} }
/* hide cursor if necessary */
if ( fb.ds.get_cursor_row() == 0 ) {
fb.ds.cursor_visible = false;
}
OverlayEngine::apply( fb ); OverlayEngine::apply( fb );
} }