[Spice-devel] [spice-gtk PATCH v1] spice-widget: keypress-delay set by env var

Marc-André Lureau mlureau at redhat.com
Thu Jun 18 03:42:04 PDT 2015


hi

----- Original Message -----
> ---
>  src/spice-widget.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 260fda5..6541e0b 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -1209,8 +1209,14 @@ static void send_key(SpiceDisplay *display, int
> scancode, SendKeyType type, gboo
>          if (press_delayed &&
>              d->keypress_delay != 0 &&
>              !(d->key_state[i] & m)) {
> +            const gchar *env = g_getenv("SPICE_KEYPRESS_DELAY");
> +            guint delay = d->keypress_delay;
>              g_warn_if_fail(d->key_delayed_id == 0);
> -            d->key_delayed_id = g_timeout_add(d->keypress_delay,
> key_press_delayed, display);
> +            if (env != NULL)
> +                delay = (guint) g_ascii_strtoull(env, NULL, 10);
> +
> +            SPICE_DEBUG ("keypress-delay is: %u ms", delay);
> +            d->key_delayed_id = g_timeout_add(delay, key_press_delayed,
> display);
>              d->key_delayed_scancode = scancode;

look fine, 
but I think it should rather be set in spice_display_set_property(), so
it can be use even if keypress-delay is 0


More information about the Spice-devel mailing list