Add utilities for showing/hiding the cursor

Closes: #2570
Approved by: alexlarsson
This commit is contained in:
Matthias Clasen
2019-01-11 16:08:05 -05:00
committed by Atomic Bot
parent 6aa3faadfe
commit 3598cce951
2 changed files with 14 additions and 0 deletions

View File

@@ -58,6 +58,8 @@ typedef enum {
void flatpak_get_window_size (int *rows, int *cols);
gboolean flatpak_get_cursor_pos (int *row, int *col);
void flatpak_hide_cursor (void);
void flatpak_show_cursor (void);
/* https://bugzilla.gnome.org/show_bug.cgi?id=766370 */
#if !GLIB_CHECK_VERSION (2, 49, 3)

View File

@@ -6120,3 +6120,15 @@ flatpak_get_cursor_pos (int* row, int *col)
return res == 2;
}
void
flatpak_hide_cursor (void)
{
write (STDOUT_FILENO, FLATPAK_ANSI_HIDE_CURSOR, strlen (FLATPAK_ANSI_HIDE_CURSOR));
}
void
flatpak_show_cursor (void)
{
write (STDOUT_FILENO, FLATPAK_ANSI_SHOW_CURSOR, strlen (FLATPAK_ANSI_SHOW_CURSOR));
}