summaryrefslogtreecommitdiff
path: root/clients/terminal.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-06-21 15:55:03 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-06-21 15:55:03 -0400
commit88fd40815a6cfca0c92c4916be29676fa4512b52 (patch)
tree38381398ca8691fae1b3838cddab53c1c9934e6f /clients/terminal.c
parentd813445f16ea7d57fcdc8d0621de1aa9a4356363 (diff)
downloadweston-88fd40815a6cfca0c92c4916be29676fa4512b52.tar.gz
weston-88fd40815a6cfca0c92c4916be29676fa4512b52.tar.bz2
weston-88fd40815a6cfca0c92c4916be29676fa4512b52.zip
terminal: Only hide cursor on first key-press in a repeat sequence
Otherwise moving the pointer while holding a key down will flicker.
Diffstat (limited to 'clients/terminal.c')
-rw-r--r--clients/terminal.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/clients/terminal.c b/clients/terminal.c
index 05454689..7d6d70ab 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -401,6 +401,7 @@ struct terminal {
struct terminal_color color_table[256];
cairo_font_extents_t extents;
cairo_scaled_font_t *font_normal, *font_bold;
+ uint32_t hide_cursor_serial;
struct wl_data_source *selection;
int32_t dragging;
@@ -2127,7 +2128,7 @@ key_handler(struct window *window, struct input *input, uint32_t time,
{
struct terminal *terminal = data;
char ch[MAX_RESPONSE];
- uint32_t modifiers;
+ uint32_t modifiers, serial;
int len = 0;
modifiers = input_get_modifiers(input);
@@ -2137,7 +2138,12 @@ key_handler(struct window *window, struct input *input, uint32_t time,
handle_bound_key(terminal, input, sym, time))
return;
- input_set_pointer_image(input, CURSOR_BLANK);
+ serial = display_get_serial(terminal->display);
+ if (terminal->hide_cursor_serial != serial &&
+ state == WL_KEYBOARD_KEY_STATE_PRESSED) {
+ input_set_pointer_image(input, CURSOR_BLANK);
+ terminal->hide_cursor_serial = serial;
+ }
switch (sym) {
case XKB_KEY_F11: